pytablewriter-altcol-theme
pytablewriter-altcol-theme is a pytablewriter plugin to provide a terminal theme.
pip install pytablewriter-altcol-theme
| Sample Code: | import pytablewriter as ptw
writer = ptw.TableWriterFactory.create_from_format_name(
"markdown",
headers=["INT", "STR"],
value_matrix=[
[1, "hoge"],
[2, "foo"],
[3, "bar"],
],
margin=1,
theme="altcol",
)
writer.write_table() |
|---|
You can change the color of the theme by using the color parameter:
| Sample Code: | import pytablewriter as ptw
writer = ptw.TableWriterFactory.create_from_format_name(
"markdown",
headers=["INT", "STR"],
value_matrix=[
[1, "hoge"],
[2, "foo"],
[3, "bar"],
],
margin=1,
)
writer.set_theme("altcol", color="yellow")
writer.write_table() |
|---|
- Generate HTML example: source file and the output