十万火急,关于javascript操作table cellf.setAttribute("style","widthL:30%;font-size:14px;......"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 cellf.setAttribute("style","widthL:30%;font-size:14px;......"); 没有用啊?!还是老样子!请赐教! cellf.className="class name you want to use" <html><style> .abc{color:red;font-size:50};</style><body bgcolor="#FFFFFF"><script language="JavaScript"><!--function drawTable(){ table=document.getElementById("content_table"); var arrname="name1|name2|name3|name4" var arrn=arrname.split("|"); //ÏëÔÚtable (id=content_table)ÀïʵÏÖ //<tr> // <td class="label" width="30%">arrn[0]</td> //<td width="70%"><input type="text" name=arrn[n]></td> //<tr> //css Îļþ .label { /* replacement for celllabel,table-cell1,table-cell2,CommmonStatusLabel,td101,td103,td104 */// font-size: 14px;// font-weight: bold;// text-align: left;// color: #FFFFFF;// background-color:#74A4E6;//}if(table.childNodes.length>0){ for (i=0;i<table.childNodes.length;i++) { var temp = table.childNodes[i]; table.removeChild(temp); }}for (j=0;j<arrn.length;j++){ var row=table.insertRow(); var cellf=row.insertCell(); cellf.innerHTML=arrn[j]; cellf.setAttribute("bgColor","#74A4E6"); cellf.setAttribute("font-size","14px"); cellf.setAttribute("width","30%"); cellf.className="abc"; var cells=row.insertCell(); cells.innerHTML='<input type="text" name="'+arrn[j]+'">'; cells.setAttribute("bgColor","#74A4E6"); cellf.setAttribute("width","70%"); cellf.className="abc";}}//--></script><table border="0" cellpadding="2" cellspacing="1" id="content_table"></table><button onclick="drawTable()">add</button></body></html> IE里,OK,多谢啊!在Netscape 里执行,怎样改才对? 关于js做的选择框,左边选中移到右边那种的,我想让选择框响应一个按钮事件后,在一个模态窗口中打开,求指导 通过javascript创建一个cookie,记录第一访问网页的时间。 求高手指点 页面自动加载的JS原理和代码 子窗口上有个button,click的时候去关闭父窗口 帮我看下如何截取字符串 关于div这个元素 JS制作的时钟,如何取得服务器的时间??谢谢!! SOS…… 如果js中表单中字段的名称是由已知的变量构成,各位一般用什么方法得到字段? 请教一下iframe的height问题 框架里的问题 请教一个问题!
没有用啊?!还是老样子!
请赐教!
<style>
.abc{color:red;font-size:50};
</style>
<body bgcolor="#FFFFFF">
<script language="JavaScript">
<!--function drawTable()
{
table=document.getElementById("content_table");
var arrname="name1|name2|name3|name4"
var arrn=arrname.split("|");
//ÏëÔÚtable (id=content_table)ÀïʵÏÖ
//<tr>
// <td class="label" width="30%">arrn[0]</td>
//<td width="70%"><input type="text" name=arrn[n]></td>
//<tr>
//css Îļþ .label { /* replacement for celllabel,table-cell1,table-cell2,CommmonStatusLabel,td101,td103,td104 */
// font-size: 14px;
// font-weight: bold;
// text-align: left;
// color: #FFFFFF;
// background-color:#74A4E6;
//}
if(table.childNodes.length>0)
{
for (i=0;i<table.childNodes.length;i++)
{
var temp = table.childNodes[i];
table.removeChild(temp);
}
}
for (j=0;j<arrn.length;j++)
{
var row=table.insertRow();
var cellf=row.insertCell();
cellf.innerHTML=arrn[j];
cellf.setAttribute("bgColor","#74A4E6");
cellf.setAttribute("font-size","14px");
cellf.setAttribute("width","30%");
cellf.className="abc";
var cells=row.insertCell();
cells.innerHTML='<input type="text" name="'+arrn[j]+'">';
cells.setAttribute("bgColor","#74A4E6");
cellf.setAttribute("width","70%");
cellf.className="abc";
}
}
//-->
</script>
<table border="0" cellpadding="2" cellspacing="1" id="content_table"></table>
<button onclick="drawTable()">add</button>
</body>
</html>
在Netscape 里执行,怎样改才对?