Zarzadzanie naglowkami tabel w IronPDF

This article was translated from English: Does it need improvement?
Translated
View the article in English

Gdy mamy do czynienia z tabelami HTML, ktore rozciagaja sie na wielu stronach w pliku PDF, wazne jest, aby naglowki tabel powtarzaly sie na gorze kazdej nowej strony. Opcja CssMediaType.Print w IronPDF ulatwia to zachowanie.

// 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

Natomiast, uzycie CssMediaType.Screen spowoduje, ze Chrome wydrukuje naglowki tabeli tylko raz, na samym poczatku tabeli.

// 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

Aby uzyskac wiecej przykladow i szczegolowe fragmenty kodu dotyczace obslugi zalaman stron i tabel, mozesz odwiedzic przyklady kodu dotyczace zalaman stron i tabel.

Curtis Chau
Autor tekstów technicznych

Curtis Chau posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podrę...

Czytaj więcej
Gotowy, aby rozpocząć?
Nuget Pliki do pobrania 18,135,201 | Wersja: 2026.4 just released
Still Scrolling Icon

Wciąż przewijasz?

Czy chcesz szybko dowodu? PM > Install-Package IronPdf
Uruchom przykład i zobacz, jak Twój kod HTML zamienia się w plik PDF.