首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

关于表格背景色的有关问题

2012-11-06 
关于表格背景色的问题这个表格里面有跨行的单元,他的背景色显示的就是一半一半的,怎么能让它全部显示一个

关于表格背景色的问题

这个表格里面有跨行的单元,他的背景色显示的就是一半一半的,怎么能让它全部显示一个颜色呢.
代码是这样的

JScript code
<tr height="25">        <th nowrap="nowrap" rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">日期</font></th>        <th nowrap="nowrap"  rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">烧结矿</font></th>        <th nowrap="nowrap" colspan="3" background="<c:url value="/images/head.gif"/>"><font                size="2">球团</font></th>        <th nowrap="nowrap"  rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">块矿</font></th>        <th nowrap="nowrap"  rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">入炉矽石</font></th>        <th nowrap="nowrap" rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">蛇纹石</font></th>        <th nowrap="nowrap"  rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">锰矿</font></th>        <th nowrap="nowrap" rowspan="2" background="<c:url value="/images/head.gif"/>"><font                size="2">萤石</font></th>    </tr>    <tr height="25">        <th nowrap="nowrap"  background="<c:url value="/images/head.gif"/>"><font                size="2">金属球</font></th>        <th nowrap="nowrap"  background="<c:url value="/images/head.gif"/>"><font                size="2">外购球</font></th>        <th nowrap="nowrap"  background="<c:url value="/images/head.gif"/>"><font                size="2">合计</font></th>    </tr>


[解决办法]
你这个不是背景色,是背景图片,你指定的这个背景图片高度不够:/images/head.gif

最好用
class ="xxx"

style 里加:(设置垂直方向重复)

.xxx{
background:url(<c:url value="/images/head.gif"/>) repeat-y; 
}

热点排行