十万火急,关于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 里执行,怎样改才对? 服务端javascript,请求解惑 谁有在网页中弹出一个广告窗体的代码啊? 有没有办法一次性下载某页面的所有源码? javascript 怎样控制按钮自动被点击 <a href="test2.html" onclick="??">test</a> ??? 请教表单提交到邮件换行问题 <frameset>里的文件和主画面的url不同,他们之间可以互相调用javascript方法么?急!请大家帮忙。 应该不太难:请问怎样通过回车提交指定的文本框的内容 如何动态生成一表格,并在其单元格里插入不同的内容 能在浏览器上输出曲线吗?? 框架里的问题 请教一个问题!
没有用啊?!还是老样子!
请赐教!
<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 里执行,怎样改才对?