March 11, 2012| | 0 Comment
Creating HTMLTable Dynamically
The blog is intended to demonstrate the use of some HTMLControls for dynamically generating the HTMLTable on webpage using some piece of code.
Required Namespace: System.Web.UI.HtmlControls
1. Two Textboxes (txtRow & txtCol)
2. One Button (btnClick)
3. One Blank Table (htmlTable1)
Step 1: Accept the no. of Rows and Columns from User.
Step 2: Now, Initialize the new TableRow & TableCell to add Data into Table.
Step 3: You can put any data into Cell, also can make some FORMATTING for good looks, and then add this cell to the row element…
Step 4: Now, simply insert this row element into htmlTable1 to display that row on the screen.
Step 5: Now execute the web application and see the result.
In this piece of writing, we see how to generate the HTML table with user accepted rows and columns. For writing the code here I used the C# and ASP.NET.