diff --git a/RtfPipe/Html/HtmlVisitor.cs b/RtfPipe/Html/HtmlVisitor.cs index 56fca09..f19461e 100644 --- a/RtfPipe/Html/HtmlVisitor.cs +++ b/RtfPipe/Html/HtmlVisitor.cs @@ -244,9 +244,18 @@ private void ProcessLeadingTabs(Element element, List styles) private void ProcessColumns(Element table) { - var boundaries = table.Elements() - .SelectMany(e => e.Styles.OfType()) - .Select(c => c.RightBoundary) + // Get all RightBoundary of header,body and all rows + var rightBoundaries = new List(); + foreach (var mainElement in table.Elements()) + { + rightBoundaries.AddRange(mainElement.Styles.OfType().Select(c => c.RightBoundary)); + foreach (var row in mainElement.Elements()) + { + rightBoundaries.AddRange(row.Styles.OfType().Select(c => c.RightBoundary)); + } + } + + var boundaries = rightBoundaries .Distinct() .OrderBy(v => v) .Select(v => new CellIndex() { RightBoundary = v })