I tried to create a classic HTML table with a title top and left. Now I want to rotate the text in the left title by -90°.
Css only supports 90° wit
You can use writing-mode: vertical-rl;
combined with a scale transformation:
table {
text-align: left;
border-collapse: collapse;
}
td,
th {
border: 1px solid lightgrey;
padding: 0px 3px;
}
td:not(:first-child) {
min-width: 140px;
}
.table_title_top {
text-align: center;
}
.table_title_left {
text-align: center;
width: 35px;
}
.table_title_left div {
writing-mode: vertical-rl;
white-space:nowrap;
transform:scale(-1);
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
</head>
<body>
<table>
<tbody>
<tr>
<td></td>
<td colspan="100" class="table_title_top">
<div>Title Top Title Top</div>
</td>
</tr>
<tr class="calc-tr calc-tr-title">
<td rowspan="100" class="table_title_left">
<div>Title Left Title Left</div>
</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</body>
</html>