Click or drag to resize
Pdf Library for .NET

Repeat Table Headers

Some web pages might contain large html tables that will split over several pages. Select.Pdf Library can be set to repeat the header of the html table at the top of every pdf page that contains a part of that table.

This can be done setting a CSS property for the thead element of the html table. The property that needs to be set is: display: table-header-group.

Sample Code

The following html table will repeat the table header at the top of each pdf page when converted to pdf.

XML
<table>
  <thead style="display: table-header-group;">
   <tr>
      <th>Month</th>
      <th>Savings</th>
   </tr>
  </thead>
  <tbody>
   <tr>
      <td>January 2009</td>
      <td>$100</td>
   </tr>
   <tr>
      <td>February 2009</td>
      <td>$80</td>
   </tr>

   <!--// ..... many table rows that will split over several pages ...... -->

   <tr>
      <td>February 2015</td>
      <td>$200</td>
   </tr>
  </tbody>
</table>