Skip to main content

Table display

saturn:table

Iterates the input collection and generates a table from the column definitions.

An information expression only reads the PlayerView passed in. Raw numbers, strings and booleans can be used directly as constants; operand objects must have a type. See Player information.

JSON fields​

FieldTypeRequiredDefaultDescription
typeResource IDyes—saturn:table
sourceExpressionyes—Input collection, resource path or context parameter; see this page's purpose.
asStringno"item"Loop variable name.
row_idExpressionnoomittedOptional expression that generates each row's identifier.
columnsArray of objectsyes—Table column definitions, or the grid column count.

columns entries​

FieldTypeRequiredDefaultDescription
idStringyes—Column identifier; must be unique within the same table.
labelText componentyes—Column title.
valueInformation expressionyes—Evaluated for the current row; use local to read the as binding.

JSON example​

{
"type": "saturn:table",
"source": {
"type": "saturn:constant",
"value": [
{
"name": "A",
"count": 1
}
]
},
"columns": [
{
"id": "name",
"label": {
"text": "Name"
},
"value": {
"type": "saturn:text",
"value": {
"type": "saturn:local",
"path": [
"name"
]
}
}
}
]
}

This is a value to embed in the corresponding field, not a standalone loadable data pack file. The example: references in the examples must be replaced with defined entries.

Java entry point​

com.iafenvoy.saturn.data.information.expression.builtin.TableExpression. This page is based on the Codec in the current 26.1.2 source.