Horizontal Rulers
A row of - (hyphen) or = (equals) characters may be added to a table to help visually separate groups of rows.
A common example is to clearly indicate that the first row is intended to be a header, and not part of the table's data.
- psv calls a row of horizontal lines a
ruler
- ruler's are not part of a table's data
- rulers and lines of text which do not begin with a | (pipe) are treated as decoration
- psv repeats the first - or = for whole row of a ruler.
- i.e. mixing - and = within a single ruler is not possible
- psv will stretch or shrink rulers to match the table's columns
- psv will add or remove columns in a ruler as needed
- psv only: rulers may be added anywhere in or around a table
- change the ruler above to a
| === | === |…ruler (i.e. = instead of -) by adding just one character and then reformatting - add a ruler between
giraffe
andcrocodile
by adding just 4 characters to the table
The Effect of Rulers on a Table's Data
Rulers are most often used as decoration, and as such are not included in a table's data.
Here is the same data again, but with some extra rulers to group rows and provide decorative features:
Properties of a Ruler
- a ruler must begin with either a | (pipe) or + (plus) character
- a ruler must contain at least one - (minus) or = (equals) character
- a ruler may contain any amount of whitespace
- a ruler must not contain any other characters.
Specifying a new Ruler
Rulers can be defined by just 4 characters:
- the outer border (| or +)
- an optional padding character (space)
- a horizontal line character (- or =)
- an optional column separator character (| or +)
The simplest way to add a ruler is to just add a row with the characters | - (pipe, space, hyphen) and then re-format your table, psv will fill in the rest.
Here is an example, each of the lines without any text will e interpreted as rulers.
Click and see what ps does.
The subtle difference between an empty row of data
and a ruler
.
- Empty Rows
- An empty row only contains | and whitespace characters.
- Ruler
- In order to differentiate a ruler from an empty row, your must include at least 1 horizontal line character (- or =)