We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Easy Table Format Question

Thread ID:





47282 Aug 1,2006 08:27 PM UTC Aug 3,2006 10:22 PM UTC WinForms 5
Tags: PDF
Administrator [Syncfusion]
Asked On August 1, 2006 08:27 PM UTC

I have 2 Questions about table formatting:

1. I am unable to get the text in the table cells
to use a font that I set using:
table.Style.TextFont = MyFont

The text in the table will not change size and is always bold.

2. I am unable to set the cell border line width
using this:
table.Style.BordersWidth.All = 1

The above seems to set the outside table border width but does not set the borders around the cells.


Ajish [Syncfusion]
Replied On August 1, 2006 09:24 PM UTC

Hi Bill,

1) Use the following code to set size of the font to the whole table

IPDFFont tablefont=pdfDoc.Fonts.Add(FontBaseFamily.Courier);
table.Style.TextFont =tablefont;

you can also set it to individual cells using the style property of the table cells. Here is a code for doing it

table.Rows[0].Cells[0].Style.TextFont =tablefont;

2) Use the following code to set Border width


and to set the Borders of each cell you need to use the following code

table.Rows[nrow].Cells[ncols].Style.BordersWidth.All =0;

Note that PDF table model is designed to have a table border as well as borders to each cells.

Here is a sample for your reference:

Please take a look and let me know if you have any other questions.

Best Regards,

Administrator [Syncfusion]
Replied On August 1, 2006 11:00 PM UTC

Thanks Ajish,
From your example I worked out what was happening, But it does not work as expected.

At the Begining of my application I create several IPDFFont objects - for example:
Dim BigFont as IPDFFont = pdf.Fonts.Add(FontBaseFamily.TimesRoman)
BigFont.Size = 16

Dim LittleFont as IPDFFont = pdf.Fonts.Add(FontBaseFamily.TimesRoman)
LittleFont.Size = 8

As I need to print some text I use the Graphics.DrawMultiText Function and I send in either LittleFont or Bigfont as the font parameter and it works correctly and as expected.

With tables if I set the:

table.Style.TextFont = BigFont
table.Style.TextFont = LittleFont

it always uses the font that was added to the document last.

So for the example above I can set the

table.Style.TextFont = BigFont

but it always prints out as the LittleFont.

Can you clarify?
It does work if you explicitly format each cell.
So i can do that or make sure the font I want for my table was just added. I have attached an example.


Bill Table Test.zip

Ajish [Syncfusion]
Replied On August 1, 2006 11:35 PM UTC

Hi Bill,

Thank you for the sample. I was able to reproduce the issue. I have created a bug report regarding this issue, you can track the status of this issue from the following link:


Please take a look and let me know if you have any questions.


Administrator [Syncfusion]
Replied On August 3, 2006 08:42 PM UTC

I''m sure you guys will see this immediately when you start looking at the problem - but I wanted to clarify a the bug a little more. We already know the table publishes with the last font added to the pdf document object and not through the Table.Style.TextFont property. But, that is not it exactly.

It publishes the table using the last font added to the document BEFORE you use the table.ImportDataTable method.

So, whatever font was last added to the document before you ImportDataTable is the font that will be used to publish the Table.

Hope this helps,

Ajish [Syncfusion]
Replied On August 3, 2006 10:22 PM UTC

Hi Bill,

Thank you for the information. I have added your comments to this bug reports.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon