两个Table,我想在脚本中使tb2的样式和tb1的一样,包括cellSpacing=1 border=0 还有 style等等

两个Table

1<table align="center" border="0" cellpadding="0" cellspacing="1" id="tb1" style="..." width="100%">....</table>
1<table id="tb2">....</table>

我想在脚本中使tb2的样式和tb1的一样,包括cellSpacing=1 cellPadding=0 width="100%" align=center border=0 还有 style等等
因该怎么写?
---------------------------------------------------------------

1<table align="center" bgcolor="red" border="0" cellpadding="0" cellspacing="1" id="tb1" style="..." width="100%"><tr><td>....</td></tr></table>
1<table id="tb2">....</table>
1<input onclick="o=document.all.tb1.cloneNode(true);o.id='tb2';document.all.tb2.replaceNode(o)" type="button"/>

---------------------------------------------------------------

var sHTML=

 1<new_table_id>.innerHTML   
 2<new_table_id>.mergeAttributes(<old_table_id>)   
 3<new_table_id>.innerHTML=sHTML   
 4\---------------------------------------------------------------   
 5  
 6<table align="center" border="5" cellpadding="0" cellspacing="1" id="tb1" style="color:red" width="100%">
 7<tr>
 8<td width="100%">1</td>
 9</tr>
10<tr>
11<td width="100%">2</td>
12</tr>
13</table>
14<table id="tb2">
15<tr>
16<td width="100%"> 1</td>
17</tr>
18<tr>
19<td width="100%">2 </td>
20</tr>
21</table>
22<script>   
23tb2.mergeAttributes(tb1)   
24</script></new_table_id></old_table_id></new_table_id></new_table_id>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus