Markdown syntax: Tables
To add a table, use three or more dashes --- to create each column, and use pipes | to separate each column. Spaces between dashes and pipes are optional.
Notes
- Pipes do not need to be aligned, it makes no difference if they are.
- Starting and ending pipes can be omitted, ---|--- is a valid two-column format line.
- The format row can be anywhere in the table, the first data row is always the header row.
Examples
| Header | Header | Header |
| ------ | ------ | ------ |
| Data | Data | Data |
---|---|---
Header|Header|Header
Data|Data|Data
Column alignment
Text can be aligned left, right, or centered by adding a colon : to the left, right, or both sides of the dashes within the format line. Without a colon, it depends on the Styles.Paragraph.Justify property and is either left-aligned or justified. The Styles.Table.Header.Alignment property defines the alignment of the header.
Example
| Header | Header | Header | Header |
| ----------------- |:---------- |:----------:| ----------:|
| Left or justified | Left | Center | Right |
Multiline cells
Cells can hold a single line of text only by design. Use the <br> tag to simulate multiline.
Example
| Header |
| ------------------------- |
| First line<br>Second line |
Table width
Table width is limited to the layout box. If the table overflows, every column is downsized by the same factor.
However the Styles.Table.MinWrapSize property can be set to prevent some columns from being resized. this property is a percentage of the table width if there were no word wrapping. This is especially useful for numeric columns that might otherwise have their value wrapped around thousands or decimal separators.
2-line tables
The Markdown components also support 2-line tables. To do this, add three or more dashes --- to the lines before and after the block. Each line in between is a column with header and data separated by a colon :.
Example
---
Header1: Data1
Header2: Data2
---
Data cells are left-aligned by default. Add another colon : to center them and two :: to right-align them.
Example
---
Header1: Left
Header2:: Center
Header3::: Right
---