Replies: 2 comments
-
There isn't a way to do that currently, but it could potentially be added. What is your use-case here? I would have thought that padding around only one column would look odd. |
Beta Was this translation helpful? Give feedback.
-
I was trying to build a table where some columns had a vertical separator between them and other's didn't. With a normal Table, all columns (except the edges, if you turn off show_edge) have a single vertical separator column between them even with no padding. On the other hand, with a Table.grid, it sets box=None and none of the columns have vertical separators (not even whitespace), but that means they can run into one another if they are at the maximum width and there's no padding. What I wanted here was to have one column (in my case, the far left most of the time) which is unlabeled but has some "flags" shown in it, but I wanted those flags to be right up against the value in the next column over, without the usual vertical separator (which for me is whitespace). Since there's no way to control the separators on a per-column basis, I thought I might use a grid to turn those off completely but then use padding to put back that space, except for the column where I don't want it. So, the table-level would have a single character of padding (probably on the right), but the flag column would set this padding to 0. Another thought I had was to ask for negative padding, so this could be used with a regular Table but when set to -1 it would allow the value to actually overwrite the separator. I've seen that sort of thing in CSS in some cases (though I think it's usually with margin there, not padding). For now, I'm living with the whitespace between the flags and the neighboring column and it's not terrible. However, it make it less obvious that the flag is actually tightly tied to the value to its right. |
Beta Was this translation helpful? Give feedback.
-
There is a "padding" option available at the Table level which sets a default padding for all table cells, and one can use Padding() explicitly to add padding to individual cells, but I don't see a way to set a default padding to apply to all cells in a specific table column. Is there a way to do this?
I could add a wrapper function around add_row() which wrapped cells in specific columns with Padding(), but I was hoping for something a bit cleaner than that.
Beta Was this translation helpful? Give feedback.
All reactions