I have the following table (based on this answer: https://stackoverflow.com/a/22177247/10461973):
http://jsfiddle.net/e5khjfsu/1/
<table border="1">
<tr>
<th class="verticalTableHeader">0</th>
<th class="verticalTableHeader">10</th>
<th class="verticalTableHeader">100</th>
<th class="verticalTableHeader">1000</th>
<th class="verticalTableHeader">10000</th>
<th class="verticalTableHeader">100000</th>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</table>
.verticalTableHeader {
min-width: 15px;
text-align:center;
white-space:nowrap;
transform-origin:50% 50%;
transform: rotate(90deg);
}
.verticalTableHeader:before {
content:'';
padding-top:110%;/* takes width as reference, + 10% for faking some extra padding */
display:inline-block;
vertical-align:middle;
}
This leads to the following output:
The width of a column seems to depend on the length of the text. However, I would like that only the height depends on the length of the text (which might be different from the text in the example above), and that all columns have the minimum width (i.e., a width similar to the leftmost column). How can I achieve this?