Html 如何跨越两个表行的图像?
我试图跨越2个表行的背景图像,但这似乎不起作用 Html: 图像似乎将行向下推,而不是跨越accross 更新Html 如何跨越两个表行的图像?,html,html-table,Html,Html Table,我试图跨越2个表行的背景图像,但这似乎不起作用 Html: 图像似乎将行向下推,而不是跨越accross 更新 <table id="branchTable"> <tr id="thead"> <th align="center">Tel.</th> <th align="center">Fax</th> <td rowspan="2" id="branch-logo"> d</td>
<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>
电话。
传真
D
${u分行?.tel}
${u分行?.fax}
rowspan在tbody和thead之间似乎不起作用。使用tr就可以了。您忘记了表中的
s。这可能就是它行为不端的原因
正如Scott所说,您在html中使用logo
,在css中使用分支logo
编辑:此外,我完全不确定是否所有主流浏览器都支持在thead和tbody上跨单元格的行。这需要一些测试。我在你发布的html中没有看到分支标志。你的桌子有一排。事实上,由于格式错误的HTML,它实际上没有任何行。。。
#branch-logo {
background-image: url(/public/images/logo.png);
height:53px;
width:100px;
background-repeat: no-repeat;
background-position: left;
}
<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>