Home arrow HTML arrow Comparing Subtotals Using a 3D HTML Recordset
HTML

Comparing Subtotals Using a 3D HTML Recordset


The main aim of this article is to see how you can compare subtotals using a 3D HTML recordset. Subtotals result from aggregate functions such as Sum, Avg and Count on database tables. This article is the third part of a four-part series.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
November 25, 2008
TABLE OF CONTENTS:
  1. · Comparing Subtotals Using a 3D HTML Recordset
  2. · Example
  3. · Calculating Totals with a 3D Recordset
  4. · Code Explanation

print this article
SEARCH DEVARTICLES

Comparing Subtotals Using a 3D HTML Recordset
(Page 1 of 4 )

I have written two articles titled “Building a 3D HTML Table” and “Using a 3D HTML Table as a Recordset.” I advise you to read those two articles before you read this one. You should also have basic knowledge on database tables, HTML, DOM and JavaScript.

3D HTML Table Basics

The HTML specification does not give an HTML element for a 3D table. There are several ways of designing a 3D table. The design here is the one I prefer.

My design for a 3D table is as follows: to start with, you have the normal 2D table. Each cell in the table has only one element, which is a one-row table (a table with only one row). It is the cells of the one-row tables that can take arbitrary content. Each one-row table must have an ID. The following diagram illustrates how I give the IDs.

T00, T01, T02, T03, T04

T10, T11, T12, T13, T14

T20, T21, T22, T23, T24

T30, T31, T32, T33, T34

T40, T41, T42, T43, T44

T50, T51, T52, T53, T54

Each ID begins with a T, followed by the number of the 2D row that the one-row table belongs to, and then the number of the 2D column that the one-row table belongs to. You should imagine each of the one-row tables to be going into the page.

If the numbers of cells of the one-row tables are the same, then you have a cuboid, which is a regular 3D table. If they are not the same, then you have an irregular 3D table. In this article I only consider cases of regular 3D tables.

Planes

You can consider the cells to be in a 3D grid with horizontal and vertical planes. The vertical planes should be seen as 2D tables, one behind the other, into the page.

Indices

The counting of all indices begins from zero. I use the variable i to denote the index for a row in the normal 2D table; the variable j to denote the index for a column in the normal 2D table; and the variable k to denote the index for a vertical plane in the 3D table. This gives an index order of (i, j, k).

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 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.


Browsers today may not allow you to meet all of these requirements. All browsers today will allow you have a good 3D read-only recordset and some features for writing to them.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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