Open bashbunni opened 2 days ago
After thinking about this a bit, the way margin is working does make sense. It shouldn't be considered part of the width of the element (same as in CSS). Table cells should only use padding to define extra spacing within a cell.
I see two options here:
a) before rendering cells, unset margins + add a note in the godoc for tables to "use Margin
not Padding
for cell styles". (Margins don't work by default)
b) get margin values and convert that to padding before rendering the cells. (Margins are applied to padding)
Note: in both cases this change will need to be both for headers & cells
When I was learning CSS I found it so confusing that margins weren't factored into widths. I would personally err on including both the margins and padding in the calculation. Case-in-point, you were initially confused about this as well.
Beyond that, though, one should be able use to margins and padding together for, say, an effect like the following:
Anyway, this is a great candidate for the various queries that bundle margin, padding, and border like GetFrameSize
.
@meowgorithm thank you! Great point, I'll work on a fix for this then
Describe the bug Rightmost characters cut off when cell content is right-aligned with margins.
To Reproduce Steps to reproduce the behavior: If you set margins on a cell style and set the text to be right-aligned, you will see the rightmost character truncated.
Expected