pytablewriter-altrow-theme
Summary
pytablewriter-altrow-theme
is a pytablewriter plugin to provide a theme that colored rows alternatively.
Installation
pip install pytablewriter-altrow-theme
Usage
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="altrow",
)
writer.write_table() |
---|---|
Output: |
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("altrow", color="yellow")
writer.write_table() |
---|---|
Output: |
Other Examples
- HTML example: source file and the output