It's better to use methods like insertRow, insertCell, deleteRow and so on...

Search in msdn the article "How to Build Tables Dynamically"