Reputation: 1185
Below is a table with some vertical text. It works OK in Chrome and Edge, but not in Firefox. (I don't have Safari, so I cannot say anything about it.) How to fix it?
.vertical {
writing-mode: vertical-rl;
}
th, td {
max-height: 100px;
max-width: 200px;
}
<table>
<tr>
<th>Lorem ipsum</th>
<th>Lorem ipsum</th>
<th class="vertical">Lorem ipsum dolor sit amet</th>
</tr>
<tr>
<td>Lorem ipsum.</td>
<td>Lorem ipsum.</td>
<td>Lorem ipsum.</td>
</tr>
<tr>
<td>Lorem ipsum.</td>
<td>Lorem ipsum.</td>
<td>Lorem ipsum.</td>
</tr>
</table>
Chrome and Edge:
Firefox:
Upvotes: 0
Views: 704
Reputation: 71
.vertical {
writing-mode: vertical-rl;
display : block;
}
just add "display: block"
Upvotes: 1
Reputation: 298
its a bug you need to set the height and set word-break to maintain the height if it got more words :
.vertical {
writing-mode: vertical-rl;
height: 100px;
word-break: break-all;
}
Upvotes: 1