Syntax
1{{ value | table_pretty }}2{{ value | table_pretty:("Column 1", "Column 2") }}
Usage
- Optional parameters set column headers.
- Columns are padded to equal widths and the separator row expands to match.
- Data shapes and custom headers behave the same as
table.
Examples
Open in Playground| Data | 1{2 "people": [3 {4 "name": "Ada",5 "role": "Engineer"6 },7 {8 "name": "Lin",9 "role": "Designer"10 }11 ]12}
|
|---|
| Template | 1{{ people | table_pretty }}
|
|---|
| Output | 1| name | role |2| ---- | -------- |3| Ada | Engineer |4| Lin | Designer |
|
|---|
Open in Playground| Data | 1{2 "values": [3 "Ada",4 "Writer",5 "Lin",6 "Editor"7 ]8}
|
|---|
| Template | 1{{ values | table_pretty:("Name", "Role") }}
|
|---|
| Output | 1| Name | Role |2| ---- | ------ |3| Ada | Writer |4| Lin | Editor |
|
|---|