HTML Table
asp.net html 控件
html table
<script runat="server">
sub submit(sender as object, e as eventargs)
dim row,numrows,numcells,j,i
row=0
numrows=cint(rows1.value)
numcells=cint(cells1.value)
for j=1 to numrows
dim r as new htmltablerow()
row=row+1
for i=1 to numcells
dim c as new htmltablecell()
c.controls.add(new literalcontrol("row " & j & ", cell " & i))
r.cells.add(c)
next
t1.rows.add(r)
t1.visible=true
next
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<p>table rows:
<select id="rows1" runat="server">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<br>table cells:
<select id="cells1" runat="server">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<br><br>
<input type="submit" value="display table" runat="server" onserverclick="submit">
</p>
<table id="t1" border="1" runat="server" visible="false"/>
</form>
</body>
</html>
sub submit(sender as object, e as eventargs)
dim row,numrows,numcells,j,i
row=0
numrows=cint(rows1.value)
numcells=cint(cells1.value)
for j=1 to numrows
dim r as new htmltablerow()
row=row+1
for i=1 to numcells
dim c as new htmltablecell()
c.controls.add(new literalcontrol("row " & j & ", cell " & i))
r.cells.add(c)
next
t1.rows.add(r)
t1.visible=true
next
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<p>table rows:
<select id="rows1" runat="server">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<br>table cells:
<select id="cells1" runat="server">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<br><br>
<input type="submit" value="display table" runat="server" onserverclick="submit">
</p>
<table id="t1" border="1" runat="server" visible="false"/>
</form>
</body>
</html>
相关文章
- ASP.NET Web Pages 布局
- ASP.NET Web Pages – 发布
- ASP.NET Web Pages Database 参考手册
- ASP.NET Razor 语法
- ASP.NET Razor C# 逻辑
- ASP.NET MVC 页面和布局
- ASP.NET MVC 视图
- ASP.NET Repeater 控件
- ASP.NET 数据库连接
- ASP.NET 实例
- ASP.NET CompareValidator 控件
- ASP.NET AdRotator 控件
- ASP.NET DropDownList 控件
- ASP.NET HyperLink 控件
- ASP.NET ListBox 控件
- ASP.NET RadioButtonList 控件
- ASP.NET Table 控件
- ASP.NET TableCell 控件
- WebSecurity CurrentUserName 属性
- WebSecurity CreateAccount 方法