Are table width examples correct?
IAlibay opened this issue · comments
Maybe I don't understand how sphinx widths work, but if we look here; https://www.mdanalysis.org/mdanalysis-sphinx-theme/PR32/additional_samples.html#list-tables
It seems like the 50% width table is larger than alleged 100% width table, is this correct?
If the one above is is the 100% width table, I think the difference is that the 50% width sets width: 50%
but the above one sets max-width: 100%
. The actual width
is free to vary.
The table styling in general is not super nice though, I'd like to change it! I think most of the styling is from sphinx-rtd-theme.
If the one above is is the 100% width table, I think the difference is that the 50% width sets width: 50% but the above one sets max-width: 100%. The actual width is free to vary.
Unfortunately I'm not sure if I'm just being real unless and can't understand what you mean, or if there's just a key bit of information missing from that explanation.
CSS has the min-width
, width
, and max-width
s of an element. If width
is specified, the element is set to that width
as a default. If it's not set, as it is for the general list-table shown here, then the element can have any width between min-width
and max-width
. The actual width is then controlled by the widths of the elements inside, in this case the actual items in the table. Because "Item 1" and "Item 2" are relatively short strings, the top table in practice ends up quite narrow, despite being allowed to have widths of up to 100%.
I edited the text inside the tables to give a better idea -- the lower table still takes up 50% the space even though the text inside is quite short, and the table above is allowed to expand to 100%. (Note -- the width:50%
table is still allowed to expand if the text is super long, since it doesn't have a max-width
iirc.).
![Screenshot 2023-09-04 at 10 18 40 am](https://private-user-images.githubusercontent.com/31115101/265296138-e66af60f-18f2-4204-88f5-4fd945d7193a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMjk2OTYsIm5iZiI6MTcyNTAyOTM5NiwicGF0aCI6Ii8zMTExNTEwMS8yNjUyOTYxMzgtZTY2YWY2MGYtMThmMi00MjA0LTg4ZjUtNGZkOTQ1ZDcxOTNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDE0NDk1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJlOTA3MTFjNTk5Nzc3MGJiODc3N2ZmYTFkZTk5ZjNmZjg5ZWY3MmJlODlhM2M3ZGNmY2MwMjNmNjZkYWFiNDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xuEQdrD8GRbHtna766r6-fLS4C8PTYhU3gZG6CDV5hg)
That being said if different styling would be preferred, we should definitely adjust it!
I see, thanks for the explanation @lilyminium.
I personally don't hate the styling, at least it's stuff that's reasonably expected? (I know I set widths manually in a couple places in tthe mdakit registry).
I'll close as addressed?