Is it possible to add table cell padding to a bootstrap table that varies according to the viewport width?
I've checked the bootstrap documentation for an out of the box solution but nothing seemed to do quite what I wanted.
I am using a Bootstrap table to render some financial data. At present on large view ports my data looks like this:
| Column A | Column B |
| 100.00| 100.0|
| 1,000,000.00| 1,000,000.00|
The column titles need to be center aligned but the financial data must be aligned so that the decimal points match.
What I want to do is to pad or add margin to the numeric data so that on the large viewport the values are better aligned under the titles
e.g.
On the large viewport:
| Column A | Column B |
| 100.00 | 100.00 |
| 1,000,000.00 | 1,000,000.00 |
Reducing down on smaller viewports to look like this:
| Column A | Column B |
| 100.00| 100.00|
|1,000,000.00|1,000,000.00|
My mark-up is as follows:
<table class="table">
<thead>
<tr>
<th class="text-center">Column A</th>
<th class="text-center">Column B</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right">100</td>
<td class="text-right">100</td>
</tr>
<tr>
<td class="text-right">1,000,000</td>
<td class="text-right">1,000,000</td>
</tr>
</tbody>
</table>
How would I go about achieving this?
(Please note due to commercial constraints I cannot rework all areas of this inherited system for modern day best practise).