<tr>
<td width="30%" height="80%" style="background-color: aliceblue"></td>
<td width="70%" height="80%" style="background-color: black"></td>
</tr>
<tr>
<td width="100%" height="10%" style="background-color:red"></td>
</tr>
这是我的代码,
下面是效果图
只有一个td ,第二个看不到
刚刚手抖,提交点了两次,第二次为空提交上去了
<td colspan="2" height="10%" style="background-color:red"></td>
第二个tr的td不能设宽度100%
加一下内容尝试一下,另外第二个tr如果只有一个td,需要进行合并,如colspan='2'
直接
一般是不推荐的,好像是有些浏览器不支持td的width属性 都是你可以先把比例数,改成纯数字,试一下。
例:
<td width="200" height="80%" style="background-color: aliceblue"></td>
<td width="200" height="80%" style="background-color: black"></td>
前提是你的屏幕要大于两个width相加。如果能显示,证明不是浏览器问题,如果不显示,那问题可能不太好找。如果,出来了,但是再次改成百分比还是不显示,你就把这个<tr>所在的table发一下,我觉得可能是table的问题
// 你这代码太少,很难看出具体原因