1
我需要確保表格標題的高度是固定的,並根據標題單元格內容調整寬度。 (標題文本最多顯示兩行)我們如何使用樣式來完成它?另外,我想確保錶行的寬度與標題行的寬度相同(即標題行決定寬度)。固定高度和更改標題寬度(HTML表格)
注意:目前「交易部門所有者別名」排在前面。它需要分兩行。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title><link href="Styles/TestStyle.css" rel="stylesheet" type="text/css" /></head>
<body>
<div id = "divForTransactionGrid">
<div>
<table cellspacing="0" rules="all" border="1" id="grdTransactions" style="border-collapse:collapse;">
<thead>
<tr>
<th scope="col">Transaction ID</th><th scope="col">Transaction Name</th><th scope="col">Transaction Owner</th><th scope="col">Transaction Department Owner Alias Name</th>
</tr>
</thead><tbody>
<tr>
<td>1</td><td>TR1</td><td>Lijo</td><td>Lijo</td>
</tr><tr>
<td>2</td><td>TR2</td><td>Lijo</td><td>This is a test value to test the result in real time scenario. Row width should be same as header width</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
CSS
#divForTransactionGrid
{
width: 300px;
height: 250px;
overflow:scroll;
}
你能花點時間修復一下問題空間嗎? – Aristos 2012-04-02 15:14:36