I need to create an HTML table that displays numbers, and I want them aligned to the right while being placed on the left side of the cell. Here is an example:
Header A |Header B |
-1 |5000 |
1 | -20 |
100 | 1 |
The column width is variable, and I am using a font similar to Arial. Unfortunately, I am unable to modify any HTML elements like div or colgroup, nor can I use JavaScript. My only option is to apply a CSS class to the td element.
I attempted to use calc(100% - 25px)
, but the issue is that 100% refers to the width of the table rather than the column.
You can view my sample implementation here: http://jsfiddle.net/mwtL9cde/4/ (I added 50px padding there for demonstration purposes)