Skip to content

Commit d55a00d

Browse files
authored
Fix table borders being removed (#199)
Fix table borders being removed even when the specified word table style has borders.
1 parent e46adfb commit d55a00d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Html2OpenXml/Expressions/Table/TableExpression.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ protected override void ComposeStyles (ParsingContext context)
245245
tableProperties.TableBorders = tableBorders;
246246
}
247247
// is the border=0? If so, we remove the border regardless the style in use
248-
else if (tableNode.Border == 0)
248+
// but only remove border if the html style border was set, otherwise leave the border style as-is.
249+
else if (!styleBorder.IsEmpty && tableNode.Border == 0)
249250
{
250251
tableProperties.TableBorders = new TableBorders() {
251252
TopBorder = new TopBorder { Val = BorderValues.None },

0 commit comments

Comments
 (0)