ASP.NET HTML 控件Table 2

asp.net html 控件 table 2

<script  runat="server">
sub page_load(sender as object, e as eventargs)
dim rows,cells,j,i
rows=3
cells=2
for j=0 to rows-1
   dim r as new tablerow()
   for i=0 to cells-1
     dim c as new tablecell()
     c.controls.add(new literalcontrol("row " & j & ", cell " & i))
     r.cells.add(c)
   next
   table1.rows.add(r)
next
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
<asp:table id="table1" borderwidth="1" gridlines="both" runat="server" />
</form>

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