-
Notifications
You must be signed in to change notification settings - Fork 46
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
Do not center table headers by default #144
Conversation
I agree with having left-aligned table headers by default. Waiting a bit in case other TAs feel differently. |
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.
Left-aligned by default would be my preference as well, the header should follow the column contents unless in specific cases.
Off the top of my head though, I don't think we have documented anywhere about these table options for the benefit of people who might not be as familiar with rst directives. I'll drop an approve on this because it's a good change, but it's worth also adding a note to the rst cheat sheet to show how to get centred header text.
Good point @s-makin , and I feel that we should make the cheat-sheet addition in this PR. |
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 good to me, but I agree that it needs an update to the cheat sheets (both RST and MyST).
We don't have this in the style guide at the moment - do we think it's needed in there?
Can this be merged? |
When the full table is centred, we don't want the headings left-aligned. Signed-off-by: Ruth Fuchss <[email protected]>
Add examples for centering only some table cells to the cheat sheet. This also requires a custom role. Signed-off-by: Ruth Fuchss <[email protected]>
I added two commits - one to fix a problem that it now wasn't possible anymore to centre a full table, and one to add examples to the cheat sheet. |
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 good to me :)
Praise: Thanks for adding the center role to the rst_prolog
and documenting it! I like that it is defined in custom_conf.py
so that downstreams can remove or rename it if wanted/needed.
The
furo
base theme centers table headers. This looks weird in my opinion for tables with only a few columns. See for example:The source, so that you can play around with the style yourself:
Centering table headers with this change is still possible, for example:
This uses the style of
table.align-center
defined incustom.css
:sphinx-docs-starter-pack/.sphinx/_static/custom.css
Lines 29 to 32 in 1393e0b