HTML Table 2

asp.net html 控件 

html table 2

<script  runat="server">
sub submit(sender as object, e as eventargs) 
dim i,j
table1.bgcolor="yellow"
table1.bordercolor="red"
for i=0 to table1.rows.count-1
   for j=0 to table1.rows(i).cells.count-1
     table1.rows(i).cells(j).innerhtml="row " & i 
   next
next
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
<table id="table1" border="1" runat="server">
   <tr>
     <td>cell 1</td>
     <td>cell 2</td>
   </tr>
   <tr>
     <td>cell 3</td>
     <td>cell 4</td>
   </tr>
</table>
<br>
<input type="button" value="change contents" onserverclick="submit" runat="server"/>
</form>

</body>
</html>
相关文章