Columns
Last updated
Last updated
When the visible columns of an object-table
are empty, the row of columns gets hidden in its entirety. In the example below both columns evaluate to an empty string, which makes the column heading disappear.
Various fit directives are exposed for controlling column content. The default is auto
where the column attempts to divide space evenly or, if possible, expand to its maximum width.
object-table
will always respect escape sequences regardless of the fit mode being applied. In both examples below, the content will always be on at least 3 lines.
With fit="shrink"
the column will shrink to its minimum width, causing column headings and content to wrap.
With fit="no-wrap"
the column will prevent automatic wrapping, which forces the content into a single line.
With fit="auto"
(which is also the default) content will automatically wrap at the tables discretion. The table will always try to prevent horizontal scrolling by causing content to wrap when it can. In cases where content can no longer wrap to new lines, the table will start to scroll horizontally.
show-if
and hide-if
can also be applied on individual columns: