どうも、ちょげ(@chogetarou)です。
Tableの下だけに枠線をつける方法を紹介します。
方法

Tableの下だけに枠線をつけるには、引数「border」を使います。
まず、Tableの引数「border」にTableBorder()を指定します。
そして、TableBorder()の引数「bottom」にBorderSideを指定します。
Table(
border: TableBorder(
bottom: BorderSide(),
),
children: <TableRow>[
・・・
],
),
Tableの引数「border」を使うことで、Tableの下だけに枠線をつけることが出来ます。
使用例

@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Table(
border: TableBorder(
bottom: BorderSide(color: Colors.red),
),
children: <TableRow>[
TableRow(
children: [
Text('太郎'),
Text('18歳'),
Text('男'),
],
),
TableRow(
children: [
Text('花子'),
Text('16歳'),
Text('女'),
],
),
],
),
),
),
),
);
}
コメント