I have a table with numbers which I center in the cell. One row has number inputs which I center with text-align: center
. The problem is that the number is centered in the inputbox without area for the arrows (spinner). I want the value to be centered in the cell.
One solution would be to adjust the margin but I've found that the width of the spinner changes with the width of your screen. I would not like to use de margin option (unless it's possible with percentage or something)
A minimal working example of my code is:
<table>
<tr>
<td style="text-align:center">5</td>
<td style="text-align:center">10</td>
</tr>
<tr>
<td><input type="number" style="text-align:center" value=15></td>
<td><input type="number" style="text-align:center" value=8></td>
</tr>
</table>
This is what I get now, but I hope you see that it's not really nice
All help is appreciated!
BTW: not a duplicate of Center text in html number input as he is concerned about consequently centering in the input box whether the spinner is shown or not. I want the value centered in the table cell.