Adding a new row to a table when a button is pressed

liunx

Guest
I have a table and when a button is clicked a new row is added to the table. The row is added to the bottom of the table. Can I make the new row be added to the middle of the table??

ThanksHtmlTable has a property called "rows" that returns an HtmlTableRowCollection. If you look at HtmlTableRowCollection in a class browser, you will see that it has an insert method that looks like this:

public void Insert(int index, HtmlTableRow row);

So you'd probably do HtmlTable.Rows.Insert(4, HtmlTableRowInstance)

if you don't have web matrix already, you should get it - the class browser is searchable and very handy.

Hope that helps.Thank you loads! I thought it would be something really difficult but now it all works and I only had to change 2 things!

Thanks!no problem.
 
Back
Top