Home > Article > Web Front-end > How to Rotate Text Left 90 Degrees in HTML and Adjust Cell Size Accordingly?
To achieve your desired rotating effect while also adjusting cell sizes accordingly, consider using a combination of CSS and HTML.
<code class="css">th { vertical-align: bottom; text-align: center; } th span { -ms-writing-mode: tb-rl; -webkit-writing-mode: vertical-rl; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }</code>
<code class="html"><table> <tr> <th><span>Rotated text by 90 deg.</span></th> </tr> </table></code>
In this solution:
This solution requires you to wrap the rotated text in a element. The element is only necessary for Chrome because it doesn't natively support changing the text direction for
The above is the detailed content of How to Rotate Text Left 90 Degrees in HTML and Adjust Cell Size Accordingly?. For more information, please follow other related articles on the PHP Chinese website!