Quaff

QTable

Tables arrange records in rows and columns for comparison. Add sorting and formatting, or customize cells with links, status labels, and actions.

ATLAS · SPECIMEN CATALOGUE

AT-021Copper Dune
AT-022Blue Moraine
AT-023Lantern Ridge
Unsorted
info QTable API Source

interface QTableProps extends HTMLAttributes<HTMLDivElement>

bordered
?: boolean = undefined
Whether the component should have a border.

columns
: QTableColumn[] = []
Column definitions of the table.

dense
?: boolean = false
Shows the Table in dense mode (takes up less space).

flat
?: boolean = undefined
Uses flat design, removing the box-shadow around the table.

rows
: QTableRow[] = []
Rows of the table.

Usage

Basic Usage and Pagination
Pass columns and rows to display a dataset. Each column needs a unique name, a header label and a field that reads a row value. This fictional meteorite catalogue has twelve records: use the footer to change pages or the number of rows shown. Select a sortable heading once for ascending order, twice for descending order, and a third time to clear sorting.
Atlas specimen catalogue

12 records · accession, specimen and class

AT-021Copper DuneIron
AT-022Blue MoraineStone
AT-023Lantern RidgeStony-iron
AT-024Quiet BasinStone
AT-025Red MesaIron
Unsorted

On narrow screens, scroll the table sideways. Its scroll area and sort buttons are keyboard accessible.

Formatting and Custom Sorting
Use format to change a displayed value while retaining its raw value for sorting. A function field can combine row properties. A custom sort receives strings and defines the ascending comparison; QTable reverses it for descending order. Try sorting Class, Mass and Storage below.
Copper DuneIron1,840 gA / 03
Blue MoraineStone128 gB / 01
Lantern RidgeStony-iron642 gC / 02
Quiet BasinStone73 gB / 04
Red MesaIron2,560 gA / 01
Unsorted
Class
Custom order: Stone → Stony-iron → Iron.
Mass
Formatted in grams, sorted numerically and aligned right.
Storage
Cabinet and drawer combined into one field, with padded drawer numbers.
Table Appearance
flat removes the table shadow, bordered adds an outline, and dense reduces cell padding and the minimum row height. Toggle each option on the same table to compare their effects.
Table options
Dense
Flat
Bordered
AT-021Copper DuneIron
AT-022Blue MoraineStone
AT-023Lantern RidgeStony-iron
Unsorted
Filtering and Custom Cells
Filtering and selection are application state. Pass filtered rows to QTable; use bodyCell for every default cell, or bodyCellSelect to override only the column named select. Cell snippets return a <td> and preserve its supplied style. This generic snippet reads string fields directly; custom snippets handle their own formatting and computed fields. Selections here remain checked when filtering or changing pages.
Browse the collection

12 of 12 specimens shown

Select
AT-021Copper DuneIron
AT-022Blue MoraineStone
AT-023Lantern RidgeStony-iron
AT-024Quiet BasinStone
AT-025Red MesaIron
Unsorted

0 selected

Localization
Choose a language to translate pagination, sorting labels and announcements. Column headings and specimen names remain your content. The language chooser is scoped to this example; see language setup for application configuration.
AT-021Copper DuneIron
AT-022Blue MoraineStone
AT-023Lantern RidgeStony-iron
AT-024Quiet BasinStone
AT-025Red MesaIron
Unsorted