Allow for rows before json header for detailed date headers#573
Open
ZoharLiran wants to merge 1 commit intocrabbly:masterfrom
Open
Allow for rows before json header for detailed date headers#573ZoharLiran wants to merge 1 commit intocrabbly:masterfrom
ZoharLiran wants to merge 1 commit intocrabbly:masterfrom
Conversation
|
Oh! Thank you. It helped me a lot! <html>
<link rel="stylesheet" href="https://printjs-4de6.kxcdn.com/print.min.css" type="text/css">
<script src='https://printjs-4de6.kxcdn.com/print.min.js'></script>
<script type="text/javascript">
function printStyledJson() {
let data = [
{
test1: 'Test1 string',
test2: 'Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
},
{
test1: 'more Test1 string',
test2: 'more Test2 string'
}
]
const style ="@page:first { margin-top: 1in; margin-bottom: 1in;}@page { margin-top: 1.2in; margin-bottom: 1in; @top-center { content: 'Header for first page'; font-size: 24px; }@top-left { content:'2025-01-16'; font-size: 13px;} @top-right { content:'Test';font-size: 13px;} @bottom-left { content: ' [ SUM ]'; } @bottom-right { content: ' Footer for first page'; }} @media print {} table.header {} "
printJS({
printable: data,
style: style,
scanStyles: false,
properties: ['test1', 'test2'],
type: 'json',
gridStyle: 'border: 2px solid #3971A5;height: 240px;line-height:220px;',
gridHeaderStyle: 'color: red; border: 2px solid #3971A5;height: 40px;line-height:40px;',
repeatTableHeader : true
})
}
</script>
<body>
<section id="test" class="test">
<h1>Print.js Test Page</h1>
<p>
<button onClick='printStyledJson();'>
Print Styled JSON
</button>
</div>
<div>
</div>
</div>
</section>
</body>
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature adds the ability to add rows to json table header.
Could be used for a display of date grids like shown in the attached picture, and provides the benefit of repeating on all pages printed.
Usage: