You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend the Cell class from #5 to take colspan: int = 1 and rowspan: int = 1 parameters for producing cells that potentially span multiple columns and/or rows of a table.
A multicolumn/multirow cell is passed to a Txtble at the location of the cell's top-left corner. The other cells that are "covered up by"/"merged into" a multicolumn/multirow cell must be completely absent from the data array. For example, a four-column row in which the second cell is two cells wide would be written as ["Foo", Cell("Bar", colspan=2), "Baz"] ("Baz" is here the cell in the fourth column, not the third).
If all the cells in a row are "covered" by other cells, the row still has to be present as an empty sequence.
By default, the width of a multicolumn cell takes precedence over the widths of the columns it spans.
If the multicolumn cell is narrower than the sum of the widths of the columns it spans (plus column separators), the multicolumn cell is widened to fit.
If a multicolumn cell's width X is greater than the sum Y of the widths of the N columns it spans, the columns are widened to match by adding ceil((X - Y) / N) spaces to the first (X - Y) % N columns and floor((X - Y) / N) to the rest.
If restrict_width=True is set on a multicolumn Cell, the columns it spans will take precedence over it, width-wise.
If such a cell's natural width is greater than the columns it spans, its width will be reduced to match.
restrict_width has no effect on Cells that span only one column
A multicolumn/multirow cell's alignment, padding, etc. is based on that of its upper-left corner.
Extend the
Cell
class from #5 to takecolspan: int = 1
androwspan: int = 1
parameters for producing cells that potentially span multiple columns and/or rows of a table.A multicolumn/multirow cell is passed to a
Txtble
at the location of the cell's top-left corner. The other cells that are "covered up by"/"merged into" a multicolumn/multirow cell must be completely absent from the data array. For example, a four-column row in which the second cell is two cells wide would be written as["Foo", Cell("Bar", colspan=2), "Baz"]
("Baz"
is here the cell in the fourth column, not the third).By default, the width of a multicolumn cell takes precedence over the widths of the columns it spans.
X
is greater than the sumY
of the widths of theN
columns it spans, the columns are widened to match by addingceil((X - Y) / N)
spaces to the first(X - Y) % N
columns andfloor((X - Y) / N)
to the rest.restrict_width=True
is set on a multicolumn Cell, the columns it spans will take precedence over it, width-wise.restrict_width
has no effect on Cells that span only one columnA multicolumn/multirow cell's alignment, padding, etc. is based on that of its upper-left corner.
Some basic test cases for this feature can be found on the
feature/span
branch.The text was updated successfully, but these errors were encountered: