Home arrow HTML arrow Page 3 - Building a 3D HTML Table
HTML

Building a 3D HTML Table


In this article, the first one in a four-part series, I show you how you can create a three-dimensional HTML table. I assume you have basic knowledge of HTML, DOM and JavaScript.

Author Info:
By: Chrysanthus Forcha
Rating: 3 stars3 stars3 stars3 stars3 stars / 11
November 11, 2008
TABLE OF CONTENTS:
  1. · Building a 3D HTML Table
  2. · Demonstration
  3. · Open the File
  4. · Explanation of the Code

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building a 3D HTML Table - Open the File
(Page 3 of 4 )

If you have opened the file, you should see this:


DATA000 DATA010 DATA020

 

DATA100 DATA110 DATA120

 

DATA200 DATA210 DATA220



and three buttons. The above nine values are the cell contents of the first vertical pane. There are three planes, three rows and three columns in a plane. This gives you 3 x 3 x 3 = 27 cells in the example.

The first button is labeled "Scroll Inward." Click it twice and you should see the values for the next two V planes. This button allows you to scroll inward (in the z-axis); when you reach the last plane, clicking it will bring back the first plane. Click the button once more and you should see the first plane again.

The next button is labeled "Give Value." When you click this button, the content of the cell with indices (1,1,1) is given the value "woman." This cell is the middle cell in the middle V plane. Click the button. The cell now has the value "woman." You cannot see it because it is in the second vertical plane. Click the "Scroll Inward" button and you should see it.

The last button is labeled "To Five." It sets all the values of the 27 cells to 5. Click it. Use the "Scroll Inward" button to verify that all the values are now "5." When you click the button it will seem as if nothing is changing; since all the values are 5 you can't see the change.

Some DOM Features

We can carry out all of the above functions and more, thanks to some DOM features that I describe below.

Table Object Collections

cells[]: Returns an array containing each cell in a table.

rows[]: Returns an array containing each row in a table.


Table Object Methods

insertRow(): Inserts a new row in a table.

deleteRow(): Deletes a row from a table.


The features of the HTML DOM TableRow Object we shall use are as follows:


TableRow Object Collections

cells[]: Returns an array containing each cell in the table row.


TableRow Object Methods

insertCell(): Inserts a cell in a table row.


The features of the HTML DOM TableRow Object we shall use are as follows:


TableCell Object Properties

InnerHTML: Sets or returns the HTML between the start and end tags of a table cell.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials