首页 > 解决方案 > Flutter - 对齐表格中的文本

问题描述

如何对齐我的文本Table

左起第一列 ( ID),右起第二列 ( Value)。

    child: Table(                    
                        children: [
                          TableRow(children: [
                            TableCell(
                              child: Row(
                                mainAxisAlignment:
                                MainAxisAlignment.spaceAround,
                                children: <Widget>[
                                  new Text('ID'),
                                  new Text('Value'),
                                ],
                              ),
                            )
                          ]),

标签: dartflutter

解决方案


您可以使用mainAxisAlignment:MainAxisAlignment.spaceBetween而不是MainAxisAlignment.spaceAround


推荐阅读