Skip to content

pytablewriter-altrow-theme is a pytablewriter plugin to provide a theme that colored rows alternatively.

License

Notifications You must be signed in to change notification settings

thombashi/pytablewriter-altrow-theme

Repository files navigation

PyPI package version Supported Python versions Supported Python implementations CI status of Linux/macOS/Windows Test coverage: coveralls

pytablewriter-altrow-theme is a pytablewriter plugin to provide a theme that colored rows alternatively.

pip install pytablewriter-altrow-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="altrow",
)
writer.write_table()
Output:
https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_default.png

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:
https://github.com/thombashi/pytablewriter-altrow-theme/blob/master/ss/ptw-altrow-theme_example_yellow.png

About

pytablewriter-altrow-theme is a pytablewriter plugin to provide a theme that colored rows alternatively.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published