LVRS Document Viewer
components/control/Table.svx
Path: components/control/Table.svx
Table
Location: qml/components/control/display/Table.qml
Table composes TableHeader and repeated TableRow delegates for compact read-only data display.
Purpose
- Provide fixed-height, dense tabular display.
- Accept array/list-model style inputs for headers and rows.
API
Data:
headerCellItems(preferred)headerColumnsrows
Layout:
rowHeightcellWidth(0means auto width)
Visual:
backgroundColorborderColor,borderWidthheaderTextColorcellTextColordividerColor(legacy alias for row divider baseline)rowDividerColorheaderSeparatorColor
Helper methods:
rowAt(index)columnCountForRow(rowEntry)autoCellWidth(rowEntry)
Usage
import LVRS 1.0 as LV
LV.Table {
headerCellItems: [
{ label: "Name" },
{ label: "State" },
{ label: "Owner" }
]
rows: [
[{ text: "Renderer" }, { text: "Active" }, { text: "Core" }],
[{ text: "Metrics" }, { text: "Paused" }, { text: "Ops" }]
]
}
How It Works
- Header source resolves from
headerCellItemsfirst, thenheaderColumns. - Row entries are forwarded to
TableRow.cellItemsand each cell toTableCellItem.itemData. - Header and row counts are resolved for both JS arrays and model-like objects.
- Row delegates compute width either from fixed
cellWidthor auto-fit formula. - Table container clips content and enforces internal divider contract.
Advanced Example: Object Rows
import LVRS 1.0 as LV
LV.Table {
headerCellItems: [
{ label: "Service" },
{ label: "State" },
{ label: "Owner" }
]
rows: [
[{ text: "Renderer" }, { text: "Active" }, { text: "Core" }],
[{ text: "Input" }, { text: "Idle" }, { text: "UX" }]
]
}
Cell text fallback supports label/text/title object keys.