Append table to DIV - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:append

Description

Append table to DIV

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> 
  <script type="text/javascript">
    function addTable()//from w w w  . java2s  . com
{
    $('#divResults').append('<table width="320" border="1"><tr><td colspan="2" rowspan="1">' + " wdw" + '</td></tr><tr><td width="118">' + "sxs" + '</td><td width="186">' + "xs" + '</td></tr></table>');
}
    
      </script> 
 </head> 
 <body> 
  <div id="divResults"> 
  </div> 
  <button onclick="addTable()">Add Stuff</button>  
 </body>
</html>

Related Tutorials