关于span的样式问题!!!!!
Table.htc代码如下:
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="ondocumentready" HANDLER="DoInit"/>
<PUBLIC:ATTACH EVENT="onmousedown" HANDLER="trTitle_MouseDown"/>
<PUBLIC:ATTACH EVENT="onmousemove" HANDLER="trTitle_MouseMove"/>
<PUBLIC:ATTACH EVENT="onmouseup" HANDLER="trTitle_MouseUp"/>
</COMPONENT>
<script language=javascript>
function DoInit()
{
create();
}
function create(){
var html="<table style =\"table-layout:fixed\" nowrap border=\"0\" cellspacing=\"1\" cellpadding=\"1\" borderColor =\"#ebebeb\"><Tbody><tr style='behavor:url=()'><td style=\"background-color:#ffffff;cursor:hand\">";
//var html="<table border=\"1\" width=\"100%\"><tr><td>";
html+="<span style=\"background-color:red;cursor:default\">编号";
html+="</span></td><td width='200'>AAAAAA</td><td>BBBBBB</td></tr></table>";
element.document.body.insertAdjacentHTML("afterBegin",html);
//alert(html);
}
</script>
span的样式如下:
A.htm的代码如下:
<html>
<head>
<style>
span {
font-family: "宋体", "新宋体";
font-size: 9pt;
width:100%;
background-color:red;
height: 100%;
overflow: hidden;
cursor: default;
white-space: nowrap;
vertical-align: bottom;
padding-top: 4;
margin-right: 2px;
margin-left: 3px;
}
</style>
</head>
<body>
<table width=100%>
<tr style="behavor:url(../JS/Table.htc)">
<td><span width="100%">编号</span></td>
</tr>
</table>
</body>
</html>
问题是这样,页面加载后span不能填充所在的整个TD,宽度只有span中的文字宽度,怎样才能是span填充整个TD