How to create dynamic tables in HTML using javascript at runtime?

In this tutorial, you will come to know how to create dynamic tables in HTML. There are some situations when you don't know the contents of the table at design time while creating the table. In this condition, you want to load and fill the table at run time. Here in this code we will write javascript code to create the table at runtime.

Code Snippet






My First Web Page





Explanation: Here in this code snippet, in the body of the html page, there is a

tag in which we want to place a table at runtime. So, we are calling a javascript function 'CreateTable' on the load of page. It will create table at runtine and will change the innerHTML of

tag at runtime.