- Home
- Forum
- ASP.NET Web Forms
- How to change the format (like font, fontsize, etc) of a WTableCell?
How to change the format (like font, fontsize, etc) of a WTableCell?
Hi,
When I set a WTableCell there are no properties available like CharacterFormat, FontName, FontSize, etc.
Is there a way to change the format of a WTableCell like they are available for IWTextRange property CharacterFormat?
SIGN IN To post a reply.
5 Replies
MR
Manikandan Ravichandran
Syncfusion Team
February 21, 2020 01:21 PM UTC
Hi Vince,
Thank you for contacting Syncfusion support.
From the given details, we suspect that you are trying to apply formatting to the text inside the cell and so we suggest you to iterate each cell in the table and then apply formatting to the text like the following code example.
Thank you for contacting Syncfusion support.
From the given details, we suspect that you are trying to apply formatting to the text inside the cell and so we suggest you to iterate each cell in the table and then apply formatting to the text like the following code example.
|
WTable table = new WTable(document); WTableRow tableRow = table.AddRow(); WTableCell tableCell = tableRow.AddCell(); IWTextRange textRange = tableCell.AddParagraph().AppendText("Hello World"); textRange.CharacterFormat.FontSize = 14; |
Otherwise, if your requirement is to apply the formatting to the table cell, we suggest you use the ‘CellFormat’ property of the table cell as below.
|
WTable table = new WTable(document); WTableRow tableRow = table.AddRow(); WTableCell tableCell = tableRow.AddCell(); tableCell.CellFormat.BackColor = Color.Gray; |
Please refer to our UG documentation to know more about table cell formatting.
https://help.syncfusion.com/file-formats/docio/working-with-tables#apply-formatting-to-table-row-and-cell
If you think, we misunderstood your requirement, kindly share the complete runnable sample or modified sample of above along with input word document to reproduce the mentioned issue, so that we can proceed further to analyze and update you with the appropriate details.
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
VI
Vince
February 21, 2020 01:42 PM UTC
Hi,
Thanks for your reply.
My requirement is to apply the formatting to the table cell.
But as explained before there are no properties to change CharacterFormat, FontName, FontSize, etc.
Also there are no samples available to change these properties for the text in a WTableCell in https://help.syncfusion.com/file-formats/docio/working-with-tables#apply-formatting-to-table-row-and-cell
MR
Manikandan Ravichandran
Syncfusion Team
February 24, 2020 12:26 PM UTC
Hi Vince,
Thank you for your update.
As mentioned earlier, cell format does not have properties like character formatting as like WTextRanges. if you want to change the character formatting for the text inside the cell, we suggest to iterate each cell in the table and apply the required formatting to the text ranges.
Reg - Also there are no samples available to change these properties for the text in a WTableCell:
To change the formatting of the text inside the table cell, we have prepared a sample that can be downloaded from the below link.
https://www.syncfusion.com/downloads/support/forum/151789/ze/ASPNetWebforms-2012914472
Note: Please find the input Word document in “App_Data” folder of above sample location
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
Thank you for your update.
As mentioned earlier, cell format does not have properties like character formatting as like WTextRanges. if you want to change the character formatting for the text inside the cell, we suggest to iterate each cell in the table and apply the required formatting to the text ranges.
Reg - Also there are no samples available to change these properties for the text in a WTableCell:
To change the formatting of the text inside the table cell, we have prepared a sample that can be downloaded from the below link.
https://www.syncfusion.com/downloads/support/forum/151789/ze/ASPNetWebforms-2012914472
Note: Please find the input Word document in “App_Data” folder of above sample location
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran
VI
Vince
February 24, 2020 03:26 PM UTC
Hello Manikandan.
Thanks for the reply.
Your sample was the missing link for me. Thanks!
Best regards,
Vince
PN
Preethi Nesakkan Gnanadurai
Syncfusion Team
February 25, 2020 06:22 AM UTC
Hi Vince,
Most welcome.
Regards,
Preethi
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
VI Vince
- Feb 21, 2020 10:41 AM UTC
- Feb 25, 2020 06:22 AM UTC