How to set table column size in TableRow for Flutter Table
Method 1
You can use defaultColumnWidth
inside Table
if you want to set same width to each column,
Table(
defaultColumnWidth: FixedColumnWidth(200.0),
...
Output
Method 2
you can use a different width for each column.
Table(
columnWidths: {
0: FlexColumnWidth(1),
1: FlexColumnWidth(4),
2: FlexColumnWidth(4),
},
...
Output
For your specific case you can use
Table(
defaultColumnWidth: IntrinsicColumnWidth(),
...
);
, since you want the column width to adjust to the text lengths. IntrinsicColumnWidth
sizes the column based on the width of the content in each cell, ie, the column width increases or shrinks depending upon the length of the content in the cell.