The HTML specification does not give an HTML element for a 3D table. There are, however, several ways of designing a 3D table. Last week's article showed you my own way of doing so. I strongly advise you to read that one first, before you read this one, which will go into greater detail and show you how to manipulate a 3D HTML table.
Using a 3D HTML Table as a Recordset - The CSS Display Property (Page 2 of 4 )
The 3D recordset is a table. If you want its content to be seen, you should give the value of "block" to its CSS display property. If you do not want its content to be seen, you should give the value of "none" to its CSS display property.
Minimum Requirements of a Read/Write 2D Recordset
A 2D recordset should have at least the following functions:
A function to give the total number of rows of the recordset.
A function to locate a row or cell in order to access data.
A function to edit data in a row.
A function to delete a row.
A function to add a row.
Minimum Requirements of a 3D Read/Write Recordset
Thinking logically from the above requirements, as a minimum, a 3D recordset should have the following functions:
A function to give the total number of horizontal and/or vertical planes of the recordset.
A function to locate a plane, row or a cell in order to access data.
A function to edit data in a cell, row or plane.
A function to delete a plane.
A function to add a plane.
I will address these five points in this article as they concern a 3D HTML table.
Regular 3D Recordset
For a regular (rectangular) 2D recordset, if you delete a row or a column, the recordset remains regular. For a regular 3D recordset (cuboid), if you delete a row or a column the recordset becomes irregular (no longer a cuboid).
Some DOM Features
We can carry out all the above functions and more, thanks to some DOM features. Here they are.
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 into a table row.
TableCell Object Properties
InnerHTML: Sets or returns the HTML between the start and end tags of a table cell.