canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
15 stars 39 forks source link

Do not center table headers by default #144

Closed dviererbe closed 9 months ago

dviererbe commented 11 months ago

The furo base theme centers table headers. This looks weird in my opinion for tables with only a few columns. See for example:

image

The source, so that you can play around with the style yourself:

+-------------------+--------------------+
| lorem             |  ipsum             |
+===================+====================+
| dolor             | sit                |
+-------------------+--------------------+
| amet              | consectetur        |
+-------------------+--------------------+
| adipiscing        | eli                |
+-------------------+--------------------+
| sed               | do                 |
+-------------------+--------------------+

Centering table headers with this change is still possible, for example:

.. role:: center
   :class: align-center

+-------------------+--------------------+
| :center:`lorem`   | :center:`ipsum`    |
+===================+====================+
| dolor             | sit                |
+-------------------+--------------------+
| amet              | consectetur        |
+-------------------+--------------------+
| adipiscing        | eli                |
+-------------------+--------------------+
| sed               | do                 |
+-------------------+--------------------+

This uses the style of table.align-center defined in custom.css:

https://github.com/canonical/sphinx-docs-starter-pack/blob/1393e0b8b1fe2cd555bba38d80473fd67767a34d/.sphinx/_static/custom.css#L29-L32

pmatulis commented 11 months ago

I agree with having left-aligned table headers by default. Waiting a bit in case other TAs feel differently.

pmatulis commented 11 months ago

Good point @s-makin , and I feel that we should make the cheat-sheet addition in this PR.

dviererbe commented 10 months ago

Can this be merged?

ru-fu commented 10 months ago

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. Are you okay with these additions?