A plain table inside .veylo gets a sunken frame, raised header cells and thin row rules. Modifiers add zebra stripes, hover and fixed layout.
<table class="zebra hover">
<caption>Releases</caption>
<thead><tr><th>Version</th><th class="num">Size (KB)</th></tr></thead>
<tbody><tr><td>1.0.0</td><td class="num">1,204</td></tr></tbody>
</table>| Class | On | Effect |
|---|---|---|
zebra | table | Alternate row stripes (--stripe) |
hover | table | Tint the row under the pointer |
fixed | table | table-layout: fixed, equal columns, long text wraps |
num | th, td | Right-align numbers |
ctr | th, td | Centre |
chk | th, td | Narrow column for a checkbox |
sel | tr | Selected row (set for you when row selection is on) |
err | td | Error colour for a cell |
Wrap a wide table in .veylo-scroll (or .veylo-sheet) to give it a Win98 scrollbar instead of overflowing the page.
| Name | Size (KB) | Type |
|---|---|---|
| readme.txt | 4 | Text |
| setup.exe | 1204 | App |
| logo.png | 38 | Image |
<table data-veylo-sort>
<thead><tr><th data-sort>Name</th><th data-sort="num" class="num">Size</th></tr></thead>
<tbody>...</tbody>
</table>Click a header to sort, click again to reverse. Enter and Space work on a focused header, and Ctrl+click restores the original order. data-sort sorts as text (natural order); data-sort="num" sorts as numbers. Headers get aria-sort and a small arrow. Add aria-sort="ascending" to show an initial sort. Call veylo.sort(th) to sort from script.
| Name | Type |
|---|---|
| alpha | A |
| beta | B |
| gamma | C |
| delta | D |
<table data-veylo-select> <!-- multiple: Ctrl, Shift, drag -->
<table data-veylo-select="one"> <!-- single -->Rows become selectable the way files are in a file manager: click, Ctrl+click, Shift+click, drag, arrows, Ctrl+A, and Ctrl+C (copies as tab-separated text). Selected rows get .sel and a change event fires with detail.items. See Keyboard and mouse. You can combine sorting, selection and a select-all checkbox column (th.chk with data-veylo-all) on one table.
<div class="veylo-status"><span>3 versions</span><span>Newest: 1.0.0</span></div>.veylo-status is a status bar made of sunken panels. Put it under a table or at the bottom of a window. Add style="margin-left:auto" on a panel to push it to the right.
table.veylo-grid gives a spreadsheet look: row and column headers, thin cell borders, and a cell cursor. It is only styling. The cell selection, editing and formulas in the showcase are written in the page's own script.
<div class="veylo-fbar"><span class="ref">A1</span><span class="fx">fx</span><input type="text"></div>
<div class="veylo-scroll" style="overflow:auto"><table class="veylo-grid">...</table></div>| Part | Purpose |
|---|---|
.veylo-fbar | Formula bar: a cell reference box (.ref), an fx label and an input |
.veylo-grid | The grid table. Cells with .sel are selected, .cur is the active cell, th.hl highlights a header |