Tables
A table block holds a grid of values (bolt sizes, section properties, a modification factor against duration) that the rest of your calcsheet can read by key or by interpolation. It’s the sixth block type, alongside maths, text, diagram, function and page-break blocks.
Tables are available on every plan.
Create a table
Section titled “Create a table”Click where you want it, then choose Table on the beacon toolbar. You get a blank 3 × 3 grid and a name field above it.
Give the table a name. The name is how your maths refers to it, and a table without one reports “Give the table a name”. Names follow the same rules as any variable, so T, bolts and k_mod all work. A table you leave both unnamed and blank is simply discarded when you move on, like an empty maths block.
How the grid is read
Section titled “How the grid is read”One reading applies everywhere, in the block itself and in every function that reads it:
- The first row is the header row. Column labels.
- The first column is the key column. The value you look a row up by.
- Everything else is the body: the values you’re after.
So a bolt table looks like this:
| size | ||
|---|---|---|
| M12 | ||
| M16 | ||
| M20 |
size, d and A_s are headers; M12, M16 and M20 are the keys.
Filling cells in
Section titled “Filling cells in”What a cell may hold depends on where it sits.
Headers and keys
Section titled “Headers and keys”Cells in the first row and first column are labels, and are never evaluated against the rest of your sheet. That’s deliberate: a key written d is the text “d”, not your variable d and not the day unit.
Type them however reads best:
- A word:
M12,size,steel. Just type it; no quoting needed. - A number, optionally with units:
0.5,-3,3.s,20.degC,1/2. A numeric label doubles as the axis value thatinterpandinterp2interpolate along, so a table you intend to interpolate needs numbers down the key column.
Body cells
Section titled “Body cells”Body cells are ordinary maths expressions, evaluated against the shared scope in reading order. They can hold:
- a number, with or without units:
157.mm^2 - an expression using anything defined above the table, so a table can present computed results, not just constants
- a text value, typed as text (see below)
A blank body cell is simply empty.
Two things a body cell can’t be: a definition (no :=, giving “A table cell holds a value, not a definition”), or something that isn’t a single value, like a matrix or a function.
Moving around and resizing
Section titled “Moving around and resizing”While you’re in the grid:
| Key | Does |
|---|---|
| Tab / Shift+Tab | Next / previous cell, wrapping at row ends. Tab past the last cell appends a new row. |
| Enter | Down one row. On the last row, appends a new one. |
| Escape | Leave the cell. |
To change the shape deliberately, right-click the block: Insert Row Above, Insert Row Below, Insert Column Left, Insert Column Right, Delete Row, Delete Column. These act on the cell you were last in. A table never shrinks below one row and one column.
Reading a table
Section titled “Reading a table”Three functions read tables. All three are in the toolbar’s Tables group and are offered by autosuggest.
lookup: by exact key
Section titled “lookup: by exact key”lookup(T, key) returns the whole matching row; add a column to get a single cell:
Name the column either by its position, counting from 1 including the key column, or by its header label.
Keys match exactly. Text matches text; numbers and quantities match by value, converting units as needed, so a key of 10.minute is found by asking for 600.s. The header row is never searched, and if nothing matches, the message lists the keys the table does have.
interp: linear interpolation
Section titled “interp: linear interpolation”On a two-column table, interp(T, x) interpolates down the key column:
interp(K, 5.minute)On a wider table, say which column, by position or header:
interp(T, 5, 3)interp(T, 5, "b")The keys must be numbers or quantities, and must run in order. Increasing or decreasing is fine, but not jumbled. An exact key returns that cell as it stands.
interp2: bilinear interpolation
Section titled “interp2: bilinear interpolation”For a grid of values varying two ways, interp2(T, x, y) interpolates on the key column (x) and the numeric header row (y). Here the headers must be numbers too:
This is the shape most two-way design tables come in: a coefficient tabulated against one parameter down the side and another across the top.
Units in tables
Section titled “Units in tables”Units work throughout. A key column in seconds can be read with a value in minutes; a value column in millimetres interpolates to a result in millimetres. The usual unit rules apply, so the interpolation axis must be consistent, with all keys sharing one unit.
Using a table as a matrix
Section titled “Using a table as a matrix”The table’s name holds its whole grid as a matrix, header row and key column included, indexed positionally from 1:
This is the same indexing as any matrix you type by hand (see Matrices). Conversely, lookup, interp and interp2 work just as well on a matrix typed directly in a maths block, as long as it has a header row and a key column.
Display and rounding
Section titled “Display and rounding”A cell you typed as a plain value shows exactly as you typed it. A computed cell shows its result, rounded to the block’s decimal places, set per table and falling back to the calcsheet default.
A cell that fails is marked in the grid, and the error also stops the table defining its name, in the same way a bad maths block does.
Elsewhere in the app
Section titled “Elsewhere in the app”- The Navigate sidebar lists tables under Matrices & Tables, each shown as its size,
T := 3 × 3 table, so you can jump to one. - Renaming works on tables both ways round: rename the table and its readers follow; rename something the table uses and its cells follow.
- Copying a table and pasting it as text gives tab-separated rows, which paste straight into a spreadsheet.
- Mathew knows about your tables and can work with them.
See also
Section titled “See also”- Table functions: signatures, rules and messages at a glance
