Datatable
The Datatable
component is a versatile component for displaying tabular data. It allows customization of styles, sizes, and densities, providing flexibility to fit various design requirements. The Datatable
component utilizes the following subcomponents:
- DatatableHeader: Defines the header section of the datatable.
- DatatableBody: Contains the body rows of the datatable.
- DatatableRow: Used to define individual rows within the datatable.
- DatatableCell: Represents individual cells within a datatable row.
- DatatableNoData: Displayed when there is no data to show in the datatable, including an optional reload button.
Basic example
<qtm-datatable size="medium" margin-density="medium" array-style="lines">
<qtm-datatable-header>
<qtm-datatable-row>
<qtm-datatable-cell>Title</qtm-datatable-cell>
<qtm-datatable-cell>Title</qtm-datatable-cell>
</qtm-datatable-row>
</qtm-datatable-header>
<qtm-datatable-body>
<qtm-datatable-row>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
</qtm-datatable-row>
<qtm-datatable-row>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
</qtm-datatable-row>
<qtm-datatable-row>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
<qtm-datatable-cell>Data cell</qtm-datatable-cell>
</qtm-datatable-row>
</qtm-datatable-body>
</qtm-datatable>
Props
Sizes
Defines the size of the datatable. Options include 'small'
, 'medium'
, and 'large'
.
<qtm-datatable size="small">...</qtm-datatable>
<qtm-datatable size="medium">...</qtm-datatable>
<qtm-datatable size="large">...</qtm-datatable>
Array style
Determines the style of the datatable. Options include 'flat'
, 'grid'
, 'lines'
, and 'zebras'
.
<qtm-datatable array-style="flat">...</qtm-datatable>
<qtm-datatable array-style="grid">...</qtm-datatable>
<qtm-datatable array-style="lines">...</qtm-datatable>
<qtm-datatable array-style="zebras">...</qtm-datatable>
Margin density
Specifies the margin density of the datatable. Options include 'small'
, 'medium'
, and 'large'
.
<qtm-datatable margin-density="small">...</qtm-datatable>
<qtm-datatable margin-density="medium">...</qtm-datatable>
<qtm-datatable margin-density="large">...</qtm-datatable>