在IronPDF中管理表格標題
Curtis Chau
Updated: 2026年4月22日
當處理在PDF中跨越多個頁面的HTML表格時,確保表格標題在每個新頁面的頂部重複顯示是很重要的。 IronPDF的CssMediaType.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相反地,使用CssMediaType.Screen將導致Chrome僅於表格的最開頭列印一次表格標題。
// 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有關處理分頁符號和表格的更多範例及詳細程式碼片段,您可以參考處理分頁符號和表格的程式碼範例。

技術作家
Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。
...
閱讀更多