將div與float:使用div作爲標題文本,float:使用右邊的圖像。垂直對齊:頂部標題。對於討厭的着色感到抱歉。我不是設計師。
你可以在jsfiddle擺弄它。
測試表:
<table>
<tr>
<th>
<div class="title">a header with a </br>br thing </div>
<div class="updown">up down</div></th>
<th>
<div class="title">a header</div>
<div class="updown">up down</div>
</th>
<th>
<div class="title">more headers</div>
<div class="updown">up down</div>
</th>
</tr>
</table>
風格:
th, td { border: 1px solid green; }
th { width: 200px; vertical-align: top; }
.title { float: left; border: solid 1px purple; overflow: hide; }
.updown { border: solid 1px red; float: right; }
這是我嘗試的第一件事,但它似乎並沒有工作 - 你有這個工作的例子嗎? –
如果上面的回答對你沒有幫助,你可以發佈你的代碼嗎? – lampej