Tables
Tables and their variants, defined in table.css.
Basic
Applies to <table>. Add the table class to other elements. Header cells in <thead> have a background; <th> elsewhere is semibold without one. <caption> is placed below the table.
| Component | Stylesheet | Script |
|---|---|---|
| Button | button.css | None |
| Slider | slider.css | slider.js |
| Popup | popup.css | popup.js |
Variants
table-bordered draws a border around every cell. table-striped gives every second row a background, and table-hover highlights the row under the pointer. They can be combined.
| Hue | Angle | Whiteness | Blackness |
|---|---|---|---|
| red | 0 | 20% | 0% |
| orange | 25 | 20% | 0% |
| yellow | 50 | 20% | 0% |
| green | 155 | 20% | 0% |
| cyan | 190 | 20% | 0% |
| sky | 210 | 20% | 0% |
| blue | 230 | 20% | 0% |
| purple | 270 | 20% | 0% |
| pink | 320 | 20% | 0% |
<table class="table-striped table-hover">…</table>Numeric cells
Cells with table-numeric are aligned to the end and use tabular figures, so digits line up.
| Item | Normal | table-numeric |
|---|---|---|
| One | 1.00 | 1.00 |
| Eleven | 11.11 | 11.11 |
| Thousand | 1,000.00 | 1,000.00 |
Horizontal scrolling
Wrap a wide table in table-scroll to scroll the table instead of the page. The table is at least as wide as the container.
| Name | red | orange | yellow | green | cyan | sky | blue | purple | pink |
|---|---|---|---|---|---|---|---|---|---|
| dark | --color-red-dark | --color-orange-dark | --color-yellow-dark | --color-green-dark | --color-cyan-dark | --color-sky-dark | --color-blue-dark | --color-purple-dark | --color-pink-dark |
| normal | --color-red-normal | --color-orange-normal | --color-yellow-normal | --color-green-normal | --color-cyan-normal | --color-sky-normal | --color-blue-normal | --color-purple-normal | --color-pink-normal |
| bright | --color-red-bright | --color-orange-bright | --color-yellow-bright | --color-green-bright | --color-cyan-bright | --color-sky-bright | --color-blue-bright | --color-purple-bright | --color-pink-bright |
<div class="table-scroll">
<table>…</table>
</div>Customization
Change the cell padding with --table-padding (default 8px 12px) and the colors with --color-table-*.
| Compact | Value |
|---|---|
| One | 1 |
| Ten | 10 |
| Hundred | 100 |
.compact {
--table-padding: 4px 8px;
--color-table-header-background: var(--color-blue-opacity-20);
}