HTML
  Home arrow HTML arrow Using the HTML Table Element as a Recordse...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Using the HTML Table Element as a Recordset
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2008-07-21

    Table of Contents:
  • Using the HTML Table Element as a Recordset
  • Minimum Requirements of a Read/Write Recordset
  • Our Illustrative Web Page
  • Editing Data
  • Add a Row

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using the HTML Table Element as a Recordset


    (Page 1 of 5 )

    When you query a database, the result you receive is a recordset. The form in which your result can be presented is affected by the capabilities of the language you use. This can present a challenge for certain languages. This article presents one way to meet that challenge if you program for the web.

    Introduction

    This article is written for those who have basic knowledge in database programming, HTML, CSS and JavaScript.

    Recordset is a name given to the result of a database query. There are other names for it, such as resultSet. This result is in the memory of the client’s computer. For a language like C++, there are APIs, which link the database program (code to manipulate the data) to the database engine. These APIs have (produce) the recordset, which is accessed by the programming language (C++).

    If we are to use JavaScript as the programming language, what recordset shall we use? JavaScript offers a two-dimensional array whose columns can be of different data types. The problem here is that JavaScript’s two-dimensional array is not well developed. It does not have the properties and methods that classical recordsets have.

    But what about the HTML TABLE element? The HTML TABLE element has the properties and methods that classical recordsets have. The cell data is the content of a table cell. But the HTML table and its content, by default, appears on the browser page, while the content of a classical recordset does not appear on the client’s document window! If you give the HTML Table the style property, display:none, it will not appear or occupy space on the browser’s window.

    Seen as a recordset, the field data of a row of the TABLE element is the content of the TD element. This can be anything; it can be text, image, video or even sound. Other recordsets do not easily take (accept) non-text objects. Clearly, the HTML TABLE element can be used as a recordset.

    The HTML TABLE element as a recordset has the following advantages over classical recordsets:

    • It does not have to be only two-dimensional; it can be three- or even four-dimensional. When it comes to dimensions, you can make it as complex as you want. However, I will not address the two-dimensional case.

    • In conjunction with HTML, you need very little code (JavaScript) to make its field value (video) appear on the browser window. With another type of recordset, in conjunction with the Windows API, you need a lot of code (C++) to make the field value appear in the client’s document’s window. Note: studios use the Windows API without you being conscious of it.

    • If you want, you can see the content of the recordset without using code. To achieve this, simply allow the HTML TABLE (recordset) to have its default style of display:block and put it in a DIV element which has scroll bars and fixed dimensions. As you can see, you do not need JavaScript, C++, or Visual Basic.net to arrive at this situation. There is no other type of recordset whose data values you can see in the documents window, just like that.

    • You can give the HTML TABLE recordset field values (e.g. images) or dynamic behavior using JavaScript.

    For those of you who are not used to handling recordsets by hand, know that any good container can be used as a resultset. The C++ vector container, for example, can be used as a recordset in the C++ world. The HTML TABLE element is a container. It might not look like one, but it is.

    If you are dealing with the Internet and you have a basic (or small) database program to write, you have a couple of choices.

    • You can use HTML in place of a studio, for flexibility, and in place of the Windows API for ease of work.

    • You can use JavaScript instead of C++ or Visual Basic or Perl, etc., for ease of work and because it is easily available; its interpreter comes with the browser you can use the HTML TABLE element with the style property set to display:none, for single-row forms (see below), or with the default style display:block for tabular forms (see below). HTML TABLE is easily available (in browsers).

    This is an aspect of web development. I will handle the case of large databases in a different series.

    More HTML Articles
    More By Chrysanthus Forcha


       · Did you know that HTML indirectly gives you a recordset? This article explains all...
       · Is this supposed to be valid HTML? It's neither XHTML (there aren't any quotes...
       · I intended to give just the important points. All what you have said can be added in...
     

    HTML ARTICLES

    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset
    - Building Single Row Database Forms with HTML
    - Introduction to Database Forms with HTML
    - Another Look at Animation of Geographical Ma...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT