I've got a table where I'm rotating the th
This is the code
table.results-table span {
display:block;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
font-weight:300;
}
<table class="results-table">
<tr>
<th></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
<th><span>Test1</span></th>
</tr>
<tr>
<td>Employee 1</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
</tr>
<tr>
<td>Employee 1</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
</tr>
</table>
This works fine, however the th
is the width as if the text wasn't rotated which causes it to break on smaller screens. Is there any way to set the width so it's only as wide as the rotated text?