Github Flavoured¶
Tables can be written using the standard Github Flavoured Markdown syntax:
Cells in a column can be aligned using the :
character:
Table directive¶
To add more features to your table, you can use the {table}
directive. Here you can add a caption and label. Adding a label enables cross-referencing .
List Tables¶
The {list-table}
directive is used to create a table from data in a uniform two-level bullet list.
“Uniform” means that each sublist (second-level list) must contain the same number of list items.
CSV Tables¶
The {csv-table}
directive is used to create a table from comma-separated values (CSV) data.
Block markup and inline markup within cells is supported. Line ends are recognized within quoted cells.
Complex Tables with Style¶
It is also possible to write tables in raw HTML with rowspan
and colspan
, as well as for example:
Include tables from file¶
If you have tables in a file (e.g. output from your data analysis elsewhere), you can use the {include}
directive. This works both for HTML and LaTeX tables (table-from-file.html
).
::::{table} Area Comparisons (imported HTML file)
:label: tbl:areas-html-file
:::{include} table-from-file.html
:::
::::
Table 1:Area Comparisons (imported HTML file)
Projection | Area in square miles | ||
---|---|---|---|
Large Horizontal Area | Large Vertical Area | Smaller Square Area | |
Albers Equal Area | 7,498.7 | 10,847.3 | 35.8 |
Web Mercator | 13,410.0 | 18,271.4 | 63.0 |
Difference | 5,911.3 | 7,424.1 | 27.2 |
Percent Difference | 44% | 41% | 43% |
Notebook outputs as tables¶
You can embed Jupyter Notebook outputs as tables. See Embed and Reuse Jupyter Outputs for more information.