Hi,
I’m loading a document template and I want to apply the TableStyle’s FirstRow padding manually to another row. The issue I have is that the ConditionalStyle.__Padding
is always 0 instead of the value I set and saved in MS Word. image.png (104.4 KB)
See attached example: DotxTableStylePaddingAlwaysZero.zip (11.7 KB)
I have a template dotx with the “Table Grid” Table Style modified to have both a Default Cell Padding and a different First Row padding.
The loaded style is always 0…
var gridTableStyle = (TableStyle) doc.Styles.First(x => x.BuiltIn && x.Name == "Table Grid");
Console.WriteLine($"Table Default Top Padding: {gridTableStyle.TopPadding}");
Console.WriteLine($"Table Default Bottom Padding: {gridTableStyle.BottomPadding}");
Console.WriteLine($"Table Default Left Padding: {gridTableStyle.LeftPadding}");
Console.WriteLine($"Table Default Right Padding: {gridTableStyle.RightPadding}");
Console.WriteLine();
var firstRowStyle = gridTableStyle.ConditionalStyles.FirstRow;
Console.WriteLine($"First Row Top Padding: {firstRowStyle.TopPadding}");
Console.WriteLine($"First Row Bottom Padding: {firstRowStyle.BottomPadding}");
Console.WriteLine($"First Row Left Padding: {firstRowStyle.LeftPadding}");
Console.WriteLine($"First Row Right Padding: {firstRowStyle.RightPadding}");
Can you confirm the bug and provide a fix or workaround?
Thanks.