Flutter development notes - Table

The height of each row of the Table is determined by its content, and the width of each column is individually controlled by the columnWidths property.

Attributes:

columnWidths: Set the width of each column

defaultColumnWidth: The default width value of each column, which is equally divided by default

textDirection: Text direction

border: table border

defaultVerticalAlignment: The default vertical alignment:

textBaseline: When defaultVerticalAlignment is baseline, this property will be used

top: placed at the top

middle: vertical center

bottom: placed at the bottom

baseline: Text baseline alignment

 

1. Set the width

columnWidths: { 

///固定列宽度 
0: FixedColumnWidth(50), 

///弹性列宽度 
1: FlexColumnWidth(1), 

///宽度占所在容器的百分比(0-1) 
2: FractionColumnWidth(0.5), 
3: IntrinsicColumnWidth(flex: 0.2), 

///大于容器10%宽度,但小于等于100px 
4: MaxColumnWidth(FixedColumnWidth(100.0), FractionColumnWidth(0.1)), 
5: MinColumnWidth(FixedColumnWidth(100.0), FractionColumnWidth(0.1)), 
}

 

Guess you like

Origin blog.csdn.net/LoveShadowing/article/details/113938964