Sejda HTML to PDF : how to keep thead on all pages where a table is displayed? - pdf-generation

I'm using SEJDA API with PHP to convert HTML to PDF.
In this HTML, I have multiple tables with a variable number of rows, and each of them have a variable height, with a variable number of columns, etc.
Sometimes one (or more) table is long enough to be displayed on more than one page, so I can have a page with only rows of tbody but no thead "labels" to tell what each columns can represents.
Is there a proper way to force the thead to be shown on each page where the table is displayed ? The "css position:fixed" solution is not a good way because there is potentially more than one table and not all pages have a table on it.

Add this to your print styles:
thead {display: table-header-group;}
If your still having issues, try https://docamatic.com. There is a dynamic table template (JSON to PDF).

Related

Elements between page breaks after each tabular row in BIRT

I have a report design where I have to display each row of a table in separate pages as header and on each page I need to display separate body. In BIRT, if I set the page break property for table as always, I can see the data on separate pages but I am not able to insert other elements in between these rows. Is it possible?
You have to add multiple Detail rows. In first you'll have what you have recently, in second you can put whatever you like, just treat it as a grid.

Kendo Grid sometimes renders data sometimes does not

I have a dynamic Kendo grid, for which I get the data every time from the server with the column configuration. The grids renders the data as expected, but sometimes the grid does not render the data at all and only renders the column headers. The grid does not even recognize the column configuration, which mentions whether the column is hidden or not, column title etc.
When I refresh(ctrl+f5) the browser page the grids starts displaying normally.
When I checked the html generated in both cases I saw following difference
1- The Grid which displays correctly
Has a thead and tbody inside a single table
2- The Grid which does not display the data
Has two different divs for header and content
Please see the following image for Good Grid
And following image for Bad Grid
I am not sure why the same grid has two different htmls? Can anyone please help?
EDIT
One more thing that might be helpful.
The kendo grid definition is in a content.html file. And this file is used as a content URL for kendo tabstrip control. There are around 7 tabs and all the tabs are refering to the same content file.

Nokogiri without DIV

I am trying to scrape information from an HTML table. There are multiple tables on the page. Before each table there is a paragraph with text. I want to key off of this text field ("CONSOLIDATED" text in the pastebin below) to identify the table since there are no DIV tags on the page and therefore no other way to uniquely identify the table. How would I do this? What XPath statement would I use? Here's a link to the HTML page: http://pastebin.com/HeapZvPV
Thanks!

The responsetext from ajax page not displaying in intended position

Im my code i get a value from an ajax page , but it is displayed in a different position than i wish to display. I would like to display it in,..
<tr><td>hello</td></tr>
<tr id="showajax"><td>Ajax Value is:</td><div id="ajaxhide"></div></tr>
here the ajax value returned is displayed somewhere else.
I had used document.getElementById('ajaxhide').innerHTML=xmlhttp.responseText; inside javascript properly also.
The ajax value returned is like this
echo '<td>'."Thanks".'</td>';
Well the first thing is you're trying to dynamically resize the table. It would be better to create the cell as empty to start with and then update the content.
You've also got some invalid syntax with <div id="ajaxhide"></div> floating outside of any table cells but inside a table row. It's not just that it will fail validation and each browser may treat it differently, but also that when you're making the content change you're trying to insert a cell inside the div (which isn't technically allowed) which is inside a row (which also isn't technically allowed).
The solution is to use:
<tr id="showajax"><td>Ajax Value is:</td><td id="ajaxhide"></td></tr>
Now to make the AJAX update:
document.getElementById('ajaxhide').innerHTML=xmlhttp.responseText;
A word of warning on Internet Explorer
IE considers COL, COLGROUP, TABLE, TBODY, TFOOT, THEAD and TR to be read only. This means you can update a cell (TD, TH) but not the whole row and not the whole table. In your above example you're not trying to do that... but just be aware of the limitation if your design changes.

column width jqgrid

I am using jqgrid to display the data in 10 columns. There is one column PillName, we can store PillName as 100 caharacters in Database. While displaying in jqgrid, its displaying like in the following image:
How to show the value in a proper way so that jqgrid dont get distorted. Ideally, it should break after some characters.
or It can show some 10 characters and then after that ........(dots)?
Kindly Help?
Thanks.
I suppose that you have CSS conflicts between MVC and jqGrid. One sees problems already in the input field of the jqGrid pager. The problem for example can be fixed with additional CSS definition
input.ui-pg-input { width: auto; }
The close problem you have probably with <td> or <tr> elements. You can examine the styles of the grid cell with Developer Tools of Internet Explorer of Chrome oder with Firebug. You can also make a simple test and comment the whole MVC CSS or a large parts of the CSS. I suppose that the grid will looks OK after removing unneeded CSS declaration or including the fix like with the pager in the CSS of your projects.

Resources