@@ -87,42 +87,6 @@ public override IEnumerable<OpenXmlElement> Interpret (ParsingContext context)
87
87
return [ CreateFrame ( childElements ) ] ;
88
88
}
89
89
90
- /// <summary>
91
- /// Group all the paragraph inside a framed table.
92
- /// </summary>
93
- private Table CreateFrame ( IEnumerable < OpenXmlElement > childElements )
94
- {
95
- TableCell cell ;
96
- TableProperties tableProperties ;
97
- Table framedTable = new (
98
- tableProperties = new TableProperties {
99
- TableWidth = new ( ) { Type = TableWidthUnitValues . Auto , Width = "0" } // 100%
100
- } ,
101
- new TableGrid (
102
- new GridColumn ( ) { Width = "5610" } ) ,
103
- new TableRow (
104
- cell = new TableCell ( childElements )
105
- )
106
- ) ;
107
-
108
- if ( ! styleBorder . IsEmpty )
109
- {
110
- tableProperties . TableBorders = new TableBorders {
111
- LeftBorder = Converter . ToBorder < LeftBorder > ( styleBorder . Left ) ,
112
- RightBorder = Converter . ToBorder < RightBorder > ( styleBorder . Right ) ,
113
- TopBorder = Converter . ToBorder < TopBorder > ( styleBorder . Top ) ,
114
- BottomBorder = Converter . ToBorder < BottomBorder > ( styleBorder . Bottom )
115
- } ;
116
- }
117
-
118
- if ( runProperties . Shading != null )
119
- {
120
- cell . TableCellProperties = new ( ) { Shading = ( Shading ? ) runProperties . Shading . Clone ( ) } ;
121
- }
122
-
123
- return framedTable ;
124
- }
125
-
126
90
protected override IEnumerable < OpenXmlElement > Interpret (
127
91
ParsingContext context , IEnumerable < AngleSharp . Dom . INode > childNodes )
128
92
{
@@ -216,6 +180,7 @@ protected override void ComposeStyles (ParsingContext context)
216
180
if ( ! styleBorder . IsEmpty )
217
181
{
218
182
renderAsFramed = true ;
183
+ runProperties . Border = null ;
219
184
}
220
185
221
186
foreach ( string className in node . ClassList )
@@ -394,6 +359,43 @@ private static Paragraph CreateParagraph(ParsingContext context, IList<OpenXmlEl
394
359
return p ;
395
360
}
396
361
362
+
363
+ /// <summary>
364
+ /// Group all the paragraph inside a framed table.
365
+ /// </summary>
366
+ private Table CreateFrame ( IEnumerable < OpenXmlElement > childElements )
367
+ {
368
+ TableCell cell ;
369
+ TableProperties tableProperties ;
370
+ Table framedTable = new (
371
+ tableProperties = new TableProperties {
372
+ TableWidth = new ( ) { Type = TableWidthUnitValues . Pct , Width = "5000" } // 100%
373
+ } ,
374
+ new TableGrid (
375
+ new GridColumn ( ) { Width = "9442" } ) ,
376
+ new TableRow (
377
+ cell = new TableCell ( childElements )
378
+ )
379
+ ) ;
380
+
381
+ if ( ! styleBorder . IsEmpty )
382
+ {
383
+ tableProperties . TableBorders = new TableBorders {
384
+ LeftBorder = Converter . ToBorder < LeftBorder > ( styleBorder . Left ) ,
385
+ RightBorder = Converter . ToBorder < RightBorder > ( styleBorder . Right ) ,
386
+ TopBorder = Converter . ToBorder < TopBorder > ( styleBorder . Top ) ,
387
+ BottomBorder = Converter . ToBorder < BottomBorder > ( styleBorder . Bottom )
388
+ } ;
389
+ }
390
+
391
+ if ( runProperties . Shading != null )
392
+ {
393
+ cell . TableCellProperties = new ( ) { Shading = ( Shading ? ) runProperties . Shading . Clone ( ) } ;
394
+ }
395
+
396
+ return framedTable ;
397
+ }
398
+
397
399
/// <summary>
398
400
/// Resolve the next available <see cref="BookmarkStart.Id"/> (they must be unique).
399
401
/// </summary>
0 commit comments