DEV Community

Discussion on: How to insert rows in an HTML table body in JavaScript

Collapse
 
madeinmilwaukee profile image
Chuck Watson

Worth noting that you do not need to reference the tbody directly if the table has only one tbody. It would be useful to see this tutorial using insertCell and avoiding the html in the script, as is outlined here developer.mozilla.org/en-US/docs/W...

Collapse
 
noemelo profile image
Noé Melo Locumber

Good observation, however, when using the function insertCell and createTextNode the css styles of the table are lost.