How can I make each cell in my table have a minimum width of 3 digits and not much larger? Now I am hard coding min-width
, but I don't like to hard code a value, since I may want to change the font in the future. It's ok if Javascript is required.
<!DOCTYPE html>
<html>
<head>
<style>
td { min-width: 27px; }
</style>
</head>
<body style="font-family:sans-serif">
<table border="1">
<tr>
<td>1</td> <!-- width: 27 -->
<td>23</td> <!-- width: 27 -->
<td>456</td> <!-- width: 27 -->
<td>7890</td> <!-- width: 36 -->
</tr>
</table>
</body>
</html>