【发布时间】:2014-05-03 09:56:57
【问题描述】:
通过固定表头的宽度来旋转图像。
请看演示。列的宽度应该在 30px 左右,但不反映图像宽度(旋转的)要多得多。
想要有一个旋转的图像并且仍然保持较小的宽度(旋转后的图像的宽度可以轻松适应 td,但无法做到这一点)
尝试了几种方法,都无法获得所需的结果。任何帮助表示赞赏。
代码
<div class="bs-example">
<table class="table">
<thead>
<tr>
<th>#</th>
<th class="rotate"><image src="http://example.com/NKV2Yt" height="20" /></th>
<th class="rotate"><image src="http://example.com/NKV2Yt" height="20" /></th>
<th class="rotate"><image src="http://example.com/NKV2Yt" height="20" /></th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>M</td>
<td>O</td>
<td>@</td>
</tr>
<tr>
<td>2</td>
<td>J</td>
<td>T</td>
<td>@</td>
</tr>
<tr>
<td>3</td>
<td>L</td>
<td>t</td>
<td>@</td>
</tr>
</tbody>
</table>
</div><!-- /example -->
CSS ==>
th{
height:200px;
width:30px !important;
}
.rotate{
-webkit-transform: rotate(-90deg); /* Chrome, Safari 3.1+ */
-moz-transform: rotate(-90deg); /* Firefox 3.5-15 */
-ms-transform: rotate(-90deg); /* IE 9 */
-o-transform: rotate(-90deg); /* Opera 10.50-12.00 */
transform: rotate(-90deg); /* Firefox 16+, IE 10+, Opera 12.10+ */
}
【问题讨论】:
标签: html css html-table rotation width