.rotate_text {
writing-mode: vertical-lr;
-webkit-writing-mode: vertical-lr;
-ms-writing-mode: vertical-lr;
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
}
.rotated_cell {
width: 5%;
text-align: center;
vertical-align: center;
padding: 1px;
padding-bottom: 10px;
padding-top: 20px;
}
<table><tr>
<td class="rotate_text rotated_cell" colspan="1" rowspan ="2">Reference#<br> 6118</td>
</tr></table>
But I was expecting the number to be to the right of the word.
Why does it invert?
2
Answers
That’s an issue with the writing mode direction
Switch it to
writing-mode: vertical-rl
I can see that simply setting
writing-mode
tovertical-lr
(even before adding the rotation) reverses the order of the lines of text, so it was probably caused by that.Try removing
writing-mode
and instead using a rotation of-90deg
: