You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It's common for a column of a table to contain currency amount, and for those amounts to be right-aligned to allow for easy visual skimming.
However, the TableCell takes no CSS and does not allow for text alignment.
Describe the solution you'd like
The ability to right-align the contents of a TableCell. This could be a css property on TableCell itself, or at least correct rendering of Boxes inside TableCells such that they can fill the cell and have alignment.
Describe alternatives you've considered
Inserting other components like Box inside the cells doesn't help—the Boxes do not fill the full width of the TableCell despite css={{ width: 'fill' }}, nor can they be set to css={{ alignSelfX: 'end' }} with any success. The use of Box inside TableCell created two nests <div>s, and the outer div is limited in size—the specified CSS only applies to the inner div, which is constrained by its parent and can't adjust.
Additional context
Table that has left-aligned currency values, but which should have right-aligned values:
And failure of using Boxes with css props to align the text inside the cell:
The text was updated successfully, but these errors were encountered:
I've just discovered this is possible by using align in the TableCell or TableHeaderCell. E.g., <TableCell align="right">...</TableCell>. It would be good to have this mentioned in the documentation. The align property in <td> is deprecated, so it's a non-obvious choice.
Is your feature request related to a problem? Please describe.
It's common for a column of a table to contain currency amount, and for those amounts to be right-aligned to allow for easy visual skimming.
However, the
TableCell
takes no CSS and does not allow for text alignment.Describe the solution you'd like
The ability to right-align the contents of a
TableCell
. This could be acss
property onTableCell
itself, or at least correct rendering ofBox
es insideTableCell
s such that they can fill the cell and have alignment.Describe alternatives you've considered
Inserting other components like
Box
inside the cells doesn't help—theBox
es do not fill the full width of theTableCell
despitecss={{ width: 'fill' }}
, nor can they be set tocss={{ alignSelfX: 'end' }}
with any success. The use ofBox
insideTableCell
created two nests<div>
s, and the outerdiv
is limited in size—the specified CSS only applies to the innerdiv
, which is constrained by its parent and can't adjust.Additional context
Table that has left-aligned currency values, but which should have right-aligned values:
And failure of using
Box
es withcss
props to align the text inside the cell:The text was updated successfully, but these errors were encountered: