To start, copy the following code block and fill the ""
values.
"table": [
{
"name": "",
"source": "",
"page": 0,
"colLabels": [
"Column 1",
"Column 2"
],
"rows": [
[
"This cell is row 1, column 1",
"This cell is row 1, column 2"
],
[
"This cell is row 2, column 1",
"This cell is row 2, column 2"
]
]
}
]
"name"
— The name of the Table."source"
— Make sure it is the same as the "json"
key in the _meta."page"
— Page of the document the reward appears at (leave at 0 if not applicable)."colLabel"
— The label at the top of each column, ordered from first to last."rows"
— The content of the cells in the table, each array belongs to a new row. There should be as many entries as columns in the table.By default, tables are made rollable if the label of the first column is a type of dice, like "d4"
, and the first cell of each row is a numeric value. It can either be a single number, or two numbers as a range of values (e.g. "1-3"
).
"colLabels": [
"d6",
"What you get"
],
"rows": [
[
"1",
"A kick in the butt :("
],
[
"2-4",
"A new shiny dagger"
],
[
"5-6",
"My castle keys"
]
]
Make sure you are adding these blocks in the same level as the "name"
, "source"
, etc.
By default, tables will span their columns evenly and all text will be aligned to the left. This can be changed per-column basis, with the following code.
"colStyles": [
"col-3 text-left",
"col-9 text-right "
]
"col-x"
— Determines the width of the column. Tables follow a 1-to-12 system, so col-12
will span 100% of the width, while col-6
is 50%, etc. As an extension to this method, you can also use 1/10th subdivisions can be used, e.g. col-1-5
for 1.5/12
. The total column widths should still sum to exactly 12; enjoy doing the math."text-x"
— Determines the text alignment of the column. The options are text-left
, text-center
and text-right
."bold"
or "italic"
in conjunction with the previous methods to change the column.Rows can also be styled, if instead of an array, they are represented by an object:
"rows": [
[
"This cell is row 1, column 1",
"This cell is row 1, column 2"
],
{
"type": "row",
"style": "row-indent-first",
"row": [
"Rows may also be defined",
"As objects with additional properties"
]
}
]
A caption is a sort of title that will appear above the table.
"caption": "D100 Trinket Table"
This text will apear right below the table.
"footnotes": [
"Reroll if you land a natural 20!."
]
This text will appear before and after the table.
"intro": [
"Optional intro entries."
],
"outro": [
"Optional outro entries."
]
How to link to a Table within strings:
"{@action <table_name>|<json_source>|<optional_text_information>}"
Example:
{@table Adventuring Gear|phb}