<%@ Page Language="C#" Debug="true" %> <script runat="server"> void Page_Load(object sender, EventArgs e) { this.Label1.Text = "www.ThaiCreate.Com 1"; this.Label2.Text = "www.ThaiCreate.Com 2"; this.Label3.Text = "www.ThaiCreate.Com 3"; } </script> <html> <head> </head> <body> <form runat="server"> <asp:Table id="MyTable" runat="server" cellspacing="0" cellpadding="5" border="1"> <asp:TableRow runat="server"> <asp:TableCell colspan="2" runat="server"> <asp:Label id="Label1" text="Label" runat="Server" /> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server"> <asp:Label id="Label2" text="Label" runat="Server" /> </asp:TableCell> <asp:TableCell runat="server"> <asp:Label id="Label3" text="Label" runat="Server" /> </asp:TableCell> </asp:TableRow> </asp:Table> </form> </body> </html>
<%@ Page Language="C#" Debug="true" %> <script runat="server"> void Button1_Click(object sender, EventArgs e) { int numrows; int numcells; int i = 0; int j = 0; TableRow r; TableCell c; // Generate rows and cells numrows = Convert.ToInt32(DropDown1.SelectedItem.Value); numcells = Convert.ToInt32(DropDown2.SelectedItem.Value); for(j = 0;j <= numrows-1; j++) { r = new TableRow(); for(i = 0 ;i <= numcells-1; i++) { c = new TableCell(); c.Controls.Add(new LiteralControl("row " + j + ", cell " + i)); r.Cells.Add(c); } Table1.Rows.Add(r); } } </script> <html> <head> </head> <body> <form runat="server"> Table rows: <asp:DropDownList id="DropDown1" runat="server"> <asp:ListItem Value="1">1</asp:ListItem> <asp:ListItem Value="2">2</asp:ListItem> <asp:ListItem Value="3">3</asp:ListItem> <asp:ListItem Value="4">4</asp:ListItem> </asp:DropDownList> Table cells: <asp:DropDownList id="DropDown2" runat="server"> <asp:ListItem Value="1">1</asp:ListItem> <asp:ListItem Value="2">2</asp:ListItem> <asp:ListItem Value="3">3</asp:ListItem> <asp:ListItem Value="4">4</asp:ListItem> </asp:DropDownList> <asp:button id="Button1" onclick="Button1_Click" runat="server" Text="Generate Table"></asp:button> <hr> <asp:Table id="Table1" runat="server" Gridlines="Both" BorderWidth="1" BorderColor="black" CellSpacing="0" CellPadding="5" Font-Size="8pt" Font-Names="Verdana"></asp:Table> </form> </body> </html>
<asp:Table AccessKey="string" BackColor="color name|#dddddd" BackImageUrl="uri" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge| Inset|Outset" BorderWidth="size" Caption="string" CaptionAlign="NotSet|Top|Bottom|Left|Right" CellPadding="integer" CellSpacing="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium| Large|X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" GridLines="None|Horizontal|Vertical|Both" Height="size" HorizontalAlign="NotSet|Left|Center|Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Style="string" TabIndex="integer" ToolTip="string" Visible="True|False" Width="size" > <asp:TableFooterRow AccessKey="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double| Groove|Ridge|Inset|Outset" BorderWidth="size" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger|XX-Small|X-Small| Small|Medium|Large|X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center|Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Style="string" TabIndex="integer" TableSection="TableHeader|TableBody|TableFooter" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" > <asp:TableCell AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> <asp:TableHeaderCell AbbreviatedText="string" AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" CategoryText="string" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" Scope="NotSet|Row|Column" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> </asp:TableFooterRow> <asp:TableHeaderRow AccessKey="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double| Groove|Ridge|Inset|Outset" BorderWidth="size" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger|XX-Small|X-Small| Small|Medium|Large|X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center|Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Style="string" TabIndex="integer" TableSection="TableHeader|TableBody|TableFooter" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" > <asp:TableCell AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> <asp:TableHeaderCell AbbreviatedText="string" AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" CategoryText="string" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" Scope="NotSet|Row|Column" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> </asp:TableHeaderRow> <asp:TableRow AccessKey="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double| Groove|Ridge|Inset|Outset" BorderWidth="size" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger|XX-Small| X-Small|Small|Medium|Large|X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center|Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Style="string" TabIndex="integer" TableSection="TableHeader|TableBody|TableFooter" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" > <asp:TableCell AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> <asp:TableHeaderCell AbbreviatedText="string" AccessKey="string" AssociatedHeaderCellID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="NotSet|None|Dotted|Dashed| Solid|Double|Groove|Ridge|Inset| Outset" BorderWidth="size" CategoryText="string" ColumnSpan="integer" CssClass="string" Enabled="True|False" EnableTheming="True|False" EnableViewState="True|False" Font-Bold="True|False" Font-Italic="True|False" Font-Names="string" Font-Overline="True|False" Font-Size="string|Smaller|Larger| XX-Small|X-Small|Small|Medium|Large| X-Large|XX-Large" Font-Strikeout="True|False" Font-Underline="True|False" ForeColor="color name|#dddddd" Height="size" HorizontalAlign="NotSet|Left|Center| Right|Justify" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" RowSpan="integer" runat="server" Scope="NotSet|Row|Column" SkinID="string" Style="string" TabIndex="integer" Text="string" ToolTip="string" VerticalAlign="NotSet|Top|Middle|Bottom" Visible="True|False" Width="size" Wrap="True|False" /> </asp:TableRow> </asp:Table>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท