2
我想跨越2錶行的背景圖像,但這似乎並沒有工作。如何將圖像跨越2個表格行?
HTML:
<table id="branchTable">
<thead>
<th align="center">Tel.</th>
<th align="center">Fax</th>
<td rowspan="2" id="branch-logo"> d</td>
</thead>
<tbody>
<td align="center">${_branch?.tel}</td>
<td align="center">${_branch?.fax}</td>
</tbody>
</table>
CSS:
#branch-logo {
background-image: url(/public/images/logo.png);
height:53px;
width:100px;
background-repeat: no-repeat;
background-position: left;
}
的形象似乎被向下推動該行並沒有跨越翻過。
UPDATE
<table id="branchTable">
<tr id="thead">
<th align="center">Tel.</th>
<th align="center">Fax</th>
<td rowspan="2" id="branch-logo"> d</td>
</tr>
<tr id="tbody">
<td align="center">${_branch?.tel}</td>
<td align="center">${_branch?.fax}</td>
</tr>
</table>
行跨度似乎並不TBODY和THEAD之間的合作。使用tr是個訣竅。
我在您張貼的HTML中的任何地方都看不到'#branch-logo'。你的桌子有一排。事實上,由於格式錯誤的HTML,它確實沒有任何行。 – Scott 2012-02-05 08:25:26
很好的指針,愚蠢的錯誤... – emt14 2012-02-05 08:49:10