Download the library
You can specify parameters name
and column_names
You can load data by calling Table()
, or use the static method .from_table
,
as well as .from_csv
for CSV files or .from_db_cursor
for database cursors
You can export data with .print
to the console or a file, or with .stringify
to get a string
During export, you can specify alignment, border style, and cells width and height
The *
symbol indicates type-dependent alignment.
If this is a number and there are no line breaks in this cell, then align to the right; otherwise, align to the left.
The <
, ^
, and >
symbols are used for left, center, and right alignment, respectively
The ^
symbol stands for top alignment,
-
for center alignment,
and _
for bottom alignment
You can also use constants from the HorizontalAlignment
and VerticalAlignment
enums instead of symbols
When exporting, you can specify the theme
parameter with one of the following options:
ascii_thin
,
ascii_thin_double
,
ascii_double
,
ascii_double_thin
,
thin
,
thin_thick
,
thin_double
,
rounded_double
,
rounded
,
rounded_thick
,
thick
,
thick_thin
,
double
,
double_thin
,
booktabs
,
ascii_booktabs
,
markdown
These themes are available through the Themes
class.
For example: Themes.thin_thick
You can also create your own themes using the Theme
class
You can include a table inside a table
You can format the text using ANSI codes (color, links, etc.) or write your own formatting, for example HTML.
All formatting works correctly with line breaks and alignment