[英]Flutter, How to do like this table?
You can use Table
, like this:您可以像这样使用
Table
:
Container(
color: Colors.white,
margin: EdgeInsets.all(20.0),
child: Table(
border: TableBorder.all(color: Colors.black),
children: [
TableRow(children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Full Name',
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Sarah'),
),
]),
TableRow(children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Email',
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Sarah@gamil.com'),
),
])
],
),
),
You can find more about Table widget here您可以在此处找到有关表格小部件的更多信息
Flutter has a Table class for this (but you can also do it using simple Row + Column combo). Flutter 有一个 Table class(但您也可以使用简单的 Row + Column 组合来完成)。
Here's the link to the Table docs: Flutter Table这是表文档的链接: Flutter 表
Container(
color: Colors.white,
padding: EdgeInsets.all(20.0),
child: Table(
border: TableBorder.all(color: Colors.black),
children: [
TableRow(children: [
Text('Cell 1'),
Text('Cell 2'),
Text('Cell 3'),
]),
TableRow(children: [
Text('Cell 4'),
Text('Cell 5'),
Text('Cell 6'),
])
],
),
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.