This document describes how the cell size is calculated.
A cell’s minimum width/height could be defined in
row,
colconfig and the
cell node. Furthermore, a cell may be enlarged by multiple reasons.
1. Minimum element size
- When a cell node has width/height defined, this will be the minimum size of this cell.
- When a cell node does not have width/height defined, the value defined in the upper level row node will be used.
- When the row does not have width/height defined either, the value defined in corresponding colconfig node will be used.
- When the corresponding colconfig node does not have value defined, the value will be 0.
2. Minimum cell size
The minimum cell size is the minimum element size plus the padding size defined in padx and pady attributes.
3. Drawing cell size
A cell may be enlarged when drawing on the dialog. The reasons may include:
- A cell in the same row has bigger height.
This cell will be enlarged vertically to the same value as the highest cell in the same row.
- A cell in the same column has bigger width.
This cell will be enlarged horizontally to the same value as widest cell in the same column.
- The table is expanded to fill the window, while the row/column the cell exists in has weight greater than 0
This cell will be enlarged to the height/width of the row/column
4. Element size
When the cell is enlarged, the element in the cell may be enlarged also.
- When the cell’s sticky value has both “n” and “s” selected, the element will be enlarged vertically to fill the cell.
- When the cell’s sticky value has both “w” and “e” selected, the element will be enlarged horizontally to fill the cell.
- For background cell with “type” value “image”, and “drawmode” value “center”, the image will not be stretched larger than the image file, in order to fill the entire cell