Skip to content

Instantly share code, notes, and snippets.

@daohoangson
Created May 28, 2022 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daohoangson/178389000ff93267b1b4b77ee4554855 to your computer and use it in GitHub Desktop.
Save daohoangson/178389000ff93267b1b4b77ee4554855 to your computer and use it in GitHub Desktop.
Nested HTML table in Flutter.
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Padding(
padding: const EdgeInsets.all(16),
child: Center(
child: MyWidget(),
),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const HtmlWidget(
r"""
<table border="1">
<tr>
<td>
Hello.
</td>
<td>
<ul>
<li>One</li>
<li>
<table border="1">
<tr>
<td>Two</td>
<td>Two</td>
</tr>
</table>
</li>
<li>Three</li>
</ul>
</td>
</tr>
</table>
""",
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment