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.
Unfortunately, activation email could not send to your email. Please try again.

changing height/padding of a row/cell does not worl if using "table.ApplyStyle(BuiltinTableStyle.TableList3);"

Thread ID:

Created:

Updated:

Platform:

Replies:

127101 Oct 26,2016 04:52 AM Oct 27,2016 06:25 AM ASP.NET MVC 1
loading
Tags: DocIO
Testname
Asked On October 26, 2016 04:52 AM

changing  height/paddingof a row/cell does not worl if using "table.ApplyStyle(BuiltinTableStyle.TableList3);" additionally I use " format.IsAutoResized = true;". What to do here ?

Ayswarya Krishna Kumar [Syncfusion]
Replied On October 27, 2016 06:25 AM

Hi Customer,

Thank you for contacting Syncfusion support.

We suspect that you have missed disabling the boolean flag ‘
SamePaddingsAsTable. This flag represents the Microsoft Word’s cell options - “Same as the whole table’. Before to set the cell paddings via cell options it is un check this option. Please refer the below screenshot for more clear understanding.

 
 
 

Please find the below code snippet for accessing the ‘
SamePaddingsAsTable option to set the paddings for the table cell.


 
//Creates Word document instance 
WordDocument document = new WordDocument(); 
//Appends a section with an empty paragraph 
document.EnsureMinimal(); 
//Adds the table to the last section 
WTable table = document.LastSection.AddTable() as WTable; 
//Sets the table with 3 rows and 3 columns 
table.ResetCells(3, 3); 
//Applies table built in style - TableList3 
table.ApplyStyle(BuiltinTableStyle.TableList3); 
//Applies padding to complete table 
table.TableFormat.Paddings.Left = 10; 
//Disables the MS Word flag 'Same as the whole table' option 
table.Rows[0].Cells[0].CellFormat.SamePaddingsAsTable = false; 
//Applies the padding to the current row via cell 
table.Rows[0].Cells[0].CellFormat.Paddings.Left = 5; 
//Saves the document 
document.Save("Sample.docx"); 
//Closes the document instance 
document.Close(); 


Note: If you could still reproduce the issue at your end, please provide us the sample that reproduce the issue, along with the Word document you are using, if any? So that we could analyze further and could provide you more appropriate details at the earliest.

Regards,
Ayswarya


CONFIRMATION

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.

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.

;