Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Apr 10, 2025 2:37 pm

We are trying to change the font weight of the first column in a PdfTable with data. No code samples show how to change column styling apart from all columns when setting up the table. Any advice please?

Version used : C# SpirePDF v11.3.0 paying customer

FelixTheSloth
 
Posts: 1
Joined: Thu Apr 10, 2025 2:34 pm

Mon Apr 14, 2025 2:40 am

Hello,

Thanks for your inquiry.
Kindly note that Spire.PDF for .NET offers the PdfTable and the PdfGrid class to work with the tables in a PDF document. The PdfTable class is used to quickly create simple, regular tables without too much formatting, while the PdfGrid class is used to create more complex tables. For your needs, we recommend that you refer to this tutorial to use PdfGrid to create a table, where you can set the font for each cell individually. The code snippet for setting the font is as follows:
Code: Select all
row1.Cells[0].Style.Font = new PdfTrueTypeFont(new Font("Calibri", 13f, FontStyle.Regular), true);

If you have further questions, please feel free to write to us.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.PDF