Skip to content

Commit 7581ea7

Browse files
committed
fix: Apply margins to <table> properly
1 parent 9dc7f08 commit 7581ea7

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

packages/flutter_html_table/lib/flutter_html_table.dart

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,12 @@ import 'package:flutter_html/flutter_html.dart';
99
/// The CustomRender function that will render the <table> HTML tag
1010
CustomRender tableRender() =>
1111
CustomRender.widget(widget: (context, buildChildren) {
12-
return Container(
12+
return CssBoxWidget(
1313
key: context.key,
14-
//TODO(Sub6Resources): This needs to be computed with Units!!
15-
margin: EdgeInsets.only(
16-
left: context.style.margin?.left?.value.abs() ?? 0,
17-
right: context.style.margin?.right?.value.abs() ?? 0,
18-
bottom: context.style.margin?.bottom?.value.abs() ?? 0,
19-
top: context.style.margin?.bottom?.value.abs() ?? 0,
20-
),
21-
padding: context.style.padding?.nonNegative,
22-
alignment: context.style.alignment,
23-
decoration: BoxDecoration(
24-
color: context.style.backgroundColor,
25-
border: context.style.border,
26-
),
27-
width: context.style.width?.value, //TODO calculate actual value
28-
height: context.style.height?.value, //TODO calculate actual value
14+
style: context.style,
2915
child: LayoutBuilder(
30-
builder: (_, constraints) => _layoutCells(context, constraints)),
16+
builder: (_, constraints) => _layoutCells(context, constraints),
17+
),
3118
);
3219
});
3320

0 commit comments

Comments
 (0)