Hi. I want to know that is there any js that enable to create table in php? Such as

<table border=1>
<tr>
<th>Name</th>
</tr>
<tr>
<td>Gene</td>
</tr>
</table>

I want something like just click upon a button, a new table above will shown on the page.
Your help is greatly appreciated!

<html>
  <head>
    <script type="text/javascript">
    function makeTable() {
      var html = "<table border=1><tr><th>Name</th></tr><tr><td>Gene</td></tr></table>";
      document.getElementById("target").innerHTML = html;
    }
    </script>
  </head>
  <body>
    <div id="target"></div>
    <input type="button" onclick="makeTable();" value="Create Table" />
  </body>
</html>

NOTE: The code was not tested.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.