私はhtmlテーブルを持っていて、列の幅は固定されています。私は270度回転する必要があるコンテンツを1つの列に持っています。コンテンツの長さは動的であり、変更することができます。私は以下のコードを持っていますが、問題は、回転すると、まずテーブルのセルの幅が広がり、高さが変わってコンテンツが上向きになって消えます。また、それは細胞の底に整列しません。テーブルのセルと高さの調整でCSSの内容を回転させます
私が定義したセルの幅は固定されていますが、高さは自動調整する必要があります。ここでJSFiddleです:https://jsfiddle.net/d7c4q924/1/
そして、ここでは、私が現在持っているコードは次のとおりです。
<style type="text/css">
.container{
width:100%;
display: inline-block;
white-space: nowrap;
transform: rotate(270deg);
transform-origin: left top 0;
}
</style>
<table border="1" width="600px">
<tr>
<td width="100px">column1</td>
<td width="100px"><span class="container">this column has a dynamic length string</span></td>
<td width="100px">column3</td>
<td width="300px">column4</td>
</tr>
</table>
可能な複製http://stackoverflow.com/questions/6997631/how-to-display-vertical-text-in-table-headers-with-auto-height-without-text -ov – helb