File tree 2 files changed +12
-4
lines changed 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,12 @@ const htmlData = """
50
50
</thead>
51
51
<tbody>
52
52
<tr><td><b>Data</b></td><td>Data</td><td>Data</td></tr>
53
- <tr><td>Data</td><td>Data</td><td>Data</td></tr>
54
- <tr><td>Data</td><td>Data</td><td>Data</td></tr>
53
+ <tr>
54
+ <td>Data</td><td>Data</td><td>Data</td>
55
+ </tr>
56
+ <tr>
57
+ <td>Data</td><td>Data</td><td>Data</td>
58
+ </tr>
55
59
</tbody>
56
60
<tfoot>
57
61
<tr><td>fData</td><td>fData</td><td>fData</td></tr>
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter_html/html_parser.dart' ;
3
+ import 'package:flutter_html/src/html_elements.dart' ;
3
4
import 'package:flutter_html/src/styled_element.dart' ;
4
5
import 'package:flutter_html/style.dart' ;
5
6
import 'package:html/dom.dart' as dom;
@@ -98,8 +99,11 @@ class TableRowLayoutElement extends LayoutElement {
98
99
TableRow toTableRow (RenderContext context) {
99
100
return TableRow (
100
101
children: children.map ((c) {
101
- return RichText (text: context.parser.parseTree (context, c));
102
- }).toList ());
102
+ if (c is StyledElement && c.name == 'td' || c.name == 'th' ) {
103
+ return RichText (text: context.parser.parseTree (context, c));
104
+ }
105
+ return null ;
106
+ }).where ((c) => c != null ).toList ());
103
107
}
104
108
}
105
109
You can’t perform that action at this time.
0 commit comments