Managing Table Headers in IronPDF

When dealing with HTML tables that extend across multiple pages in a PDF, it's important to ensure that the table headers repeat at the top of each new page. IronPDF's CssMediaType.Print option facilitates this behavior.

// Set the CSS media type to 'Print' to ensure table headers repeat on every new page
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print;
// Set the CSS media type to 'Print' to ensure table headers repeat on every new page
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print;
' Set the CSS media type to 'Print' to ensure table headers repeat on every new page
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print
$vbLabelText   $csharpLabel

By contrast, using CssMediaType.Screen will result in Chrome printing the table headers only once, at the very start of the table.

// Set the CSS media type to 'Screen' if you want the headers printed only once at the start of the table
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
// Set the CSS media type to 'Screen' if you want the headers printed only once at the start of the table
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
' Set the CSS media type to 'Screen' if you want the headers printed only once at the start of the table
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
$vbLabelText   $csharpLabel

For more examples and detailed code snippets on handling page breaks and tables, you can refer to the code examples on handling page breaks and tables.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 15,842,959 | Version: 2025.10 just released