Create a table : Table « HTML « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Dojo toolkit
7. Event
8. Event onMethod
9. Ext JS
10. Form Control
11. GUI Components
12. HTML
13. Javascript Collections
14. Javascript Objects
15. Javascript Properties
16. jQuery
17. Language Basics
18. Mochkit
19. Mootools
20. Node Operation
21. Object Oriented
22. Page Components
23. Rico
24. Scriptaculous
25. Security
26. SmartClient
27. Style Layout
28. Table
29. Utilities
30. Window Browser
31. YUI Library
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript DHTML » HTML » Table 
Create a table
 

<head>
<title></title>
</script>
</head>
<body>
<div id="thetable"></div>
<script type = "text/javascript" >
var table = document.createElement("table");
table.border = "1";
var tbody = document.createElement("tbody");

table.appendChild(tbody);
var row = document.createElement("tr");

for (i = 1; i < 3; i++) {
    var row = document.createElement("tr");
    for (j = 1; j < 3; j++) {
        var td = document.createElement("td");
        var data = document.createTextNode("Row " + i + ", Column " + j);
        td.appendChild(data);
        row.appendChild(td);
    }
    tbody.appendChild(row);
}
document.getElementById("thetable").appendChild(table)
</script>
</body>

   
  
Related examples in the same category
1. Tabular data in Javascript with hyper link
2. Change the width of a table border
3. Change the cellPadding and cellSpacing of a table
4. Specify frames of a table
5. Change table row height
6. Specify rules for a table
7. Create table caption
8. Deleting table rows
9. Adding table rows
10. Align the cell content in a table row
11. Change the cell content in a table row
12. Vertical align the cell content in a table row
13. Align the cell content in a single cell
14. Vertical align the cell content in a single cell
15. Adding cells to a table row
16. Change the colspan of a table row
17. Insert table row: the uniqueID Property
18. Using the cloneNode Method
19. Cycling Through Table frame Property Values
20. Replacing Table Cell Content
21. Inserting/Removing Row Elements
22. Modifying Table Columns
23. Accessing userProfile Data
24. Cycling Through Table rows Property Values
25. Using the Data Binding record Number Property
26. Using the offsetParent Property
27. Transforming JavaScript Data into HTML Tables
28. Transforming JavaScript Data into HTML Tables with HyperLink
29. Change table border width and cell padding
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.