-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs table themes #197
Docs table themes #197
Conversation
Many table parts support customizing border colors and style. | ||
This is shown below for column labels. | ||
|
||
```{python} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't see the result of setting these options. Is there something else I need to set?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this instead:
gt_ex.tab_options(
heading_border_bottom_color="blue",
heading_border_bottom_style="solid"
)
The reason the other settings may not work is because the shared border (bottom of header, and top of column labels) has a rule where the larger sized part wins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like, if you use:
gt_ex.tab_options(
column_labels_border_top_color="blue",
column_labels_border_top_style="solid",
column_labels_border_top_width="5px",
)
Then you'll see the blue border because the 5px
size is beating out the size of the heading_border_bottom...
border.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! I might use this, and then mention the interaction of borders, if that's okay!
|
||
This requires setting a decent number of options, but makes a big difference when presenting a table! Below is a table with a simple, blue theme. (The code is hidden by default, but can be expanded to see all the options set). | ||
|
||
```{python} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I essentially derived this from the opt_stylize
R code.
|
||
## Composite options | ||
|
||
TODO: which options are handled in a special way? (e.g. `row_group_as_column = True`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea which options do a set of things, rather than a single thing? (Or which of those options would be good to illustrate---either here or in their own section).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
container_width and container_height (and container_overflow_x|y) do more complex things which are worth illustrating (especially if space is at a premium for the table on a page).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far this is looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This PR adds a page on table theming options to the Get Started guide. It's still very rough!
https://pr-197--gt-python.netlify.app/get-started/table-theme-options