为什么下面的html会产生一个包含2x2个单元而不是3行的表,第一个包含2个单元格,而下一个2个包含一个单元格跨越2个?
<table cellpadding="5" width="200">
<tr>
<td><img id="Button1_logoImg" src="" style="height:75px;width:75px;" alt="sButton1_logoImg" /></td><td><img id="Button1_errorImg" src="" style="height:50px;width:50px;" alt="Button1_logoImg" /></td>
</tr>
<tr>
<td width="100%" rowspan="2"><input name="Button1$mainTextTb" type="text" value="changed" id="Button1_mainTextTb" style="font-size:20pt;width:180px;" /></td>
</tr>
<tr>
<td rowspan="2" width="100%"><span id="Button1_subTextLbl" style="font-size:12pt;">sub text</span></td>
</tr>
</table>
答案 0 :(得分:1)
在第2行和第3行用colspan替换你的rowspan。
答案 1 :(得分:0)
你的代码
<table cellpadding="5" width="200">
<tr>
<td><img id="Button1_logoImg" src="" style="height:75px;width:75px;" alt="sButton1_logoImg" /></td><td><img id="Button1_errorImg" src="" style="height:50px;width:50px;" alt="Button1_logoImg" /></td>
</tr>
<tr>
<td width="100%" rowspan="2"><input name="Button1$mainTextTb" type="text" value="changed" id="Button1_mainTextTb" style="font-size:20pt;width:180px;" /></td>
</tr>
<tr>
<td rowspan="2" width="100%"><span id="Button1_subTextLbl" style="font-size:12pt;">sub text</span></td>
</tr>
</table>
将rowpan替换为colspan
已编辑的代码
<table cellpadding="5" width="200">
<tr>
<td><img id="Button1_logoImg" src="" style="height:75px;width:75px;" alt="sButton1_logoImg" /></td><td><img id="Button1_errorImg" src="" style="height:50px;width:50px;" alt="Button1_logoImg" /></td>
</tr>
<tr>
<td width="100%" colspan="2"><input name="Button1$mainTextTb" type="text" value="changed" id="Button1_mainTextTb" style="font-size:20pt;width:180px;" /></td>
</tr>
<tr>
<td colspan="2" width="100%"><span id="Button1_subTextLbl" style="font-size:12pt;">sub text</span></td>
</tr>
</table>