Veylo Docs

HomeDocsTables

Tables

A plain table inside .veylo gets a sunken frame, raised header cells and thin row rules. Modifiers add zebra stripes, hover and fixed layout.

Basics

Releases
VersionReleasedSize (KB)
1.0.01,204
0.9.01,187
<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>
ClassOnEffect
zebratableAlternate row stripes (--stripe)
hovertableTint the row under the pointer
fixedtabletable-layout: fixed, equal columns, long text wraps
numth, tdRight-align numbers
ctrth, tdCentre
chkth, tdNarrow column for a checkbox
seltrSelected row (set for you when row selection is on)
errtdError 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.

Sortable

NameSize (KB)Type
readme.txt4Text
setup.exe1204App
logo.png38Image
<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.

Row selection

NameType
alphaA
betaB
gammaC
deltaD
<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.

3 versionsNewest: 1.0.0
<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.

Spreadsheet grid

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>
PartPurpose
.veylo-fbarFormula bar: a cell reference box (.ref), an fx label and an input
.veylo-gridThe grid table. Cells with .sel are selected, .cur is the active cell, th.hl highlights a header