HTML
  Home arrow HTML arrow Page 2 - Tabular Database Forms with HTML
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

Tabular Database Forms with HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-08-27

    Table of Contents:
  • Tabular Database Forms with HTML
  • The Layout
  • The Layout continued
  • The addRow() Function

  • 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


    Tabular Database Forms with HTML - The Layout


    (Page 2 of 4 )

    With our tabular form, the recordset, which is the data the user sees, is housed in a DIV element. You need to give the DIV element definite width and height dimensions. We give the DIV element the CSS overflow property of "overflow:scroll." With this property, the DIV element acquires the vertical and horizontal scroll bars. You can use these bars to scroll through the recordset.

    There are three tables in the DIV element. The first table displays the titles for the recordset columns. The second table is the recordset. The third table displays the buttons (Add, Edit etc.). You have to make sure that the columns of the first and second tables are aligned. You have to choose the dimensions of the three tables so that they fit well in the DIV element.

    As you can see from the above figure, there are no navigation buttons. We do not need them here. We have the scroll bars for that. So the lines for the navigation buttons and their JavaScript functions are removed from the code.

    Recall that for the Single-Row Form the CSS display property for the recordset table is "display:none." Here we do not need that property. The default behavior of an HTML table is to be displayed as a block level element and to occupy space. Our recordset in the DIV element does not have that property.

    Now that we have a table as the recordset, which is seen by the user, how can he edit data? For the Single-Row Form, data was entered in Input Text Controls. There were only six Input Text Controls corresponding to the six visible columns. Data was sent from the controls to a row in the recordset and back.

    The solution here is to have one Input Text Control for each cell in the recordset. You set all their read-only property to "true." When the user wants to edit a row, you set the read-only property for all the Input Text Controls for that row to "false."

    I will address the case when data is an image later. In this and the next part of the series I will talk only about small text data.

    If you allow the default values for cellspacing and cellpadding for the recordset table, the gaps between the Input Text Control data will be rather wide. To make the gaps look conventional, set the cellspacing and cellpadding attributes to zero.

    For the Single-Row Form we had to indicate the record position and the total number of rows. Here we can see the rows or simply scroll to see what is not visible. The size of the gray box of the vertical scroll bar indicates how long the recordset is. So we do not really need to indicate the row position and the total number of rows. For the sake of design simplicity we remove this feature and its corresponding code.

    If your recordset is sorted, then you can easily scroll up or down to see a particular record. So we do not really need the Find function. For the sake of design simplicity we remove this feature and its corresponding code.

    In the web page here, there is a main table for the page layout. Our DIV element is in a cell of this table. This is the content of the body element for the web page:

    <body onload="start()">

    <table>

    <tbody>

    <tr>

    <td width="150">


    </td>

    <td>

    <br /><br /><br /><br />

    <table id="CT1">

    <tr>

    <table width="420">

    <COLGROUP>

    <col span="6" width="70">

    </COLGROUP>

    <tr><th>ID</th><th>Name</th><th>Dep't</th><th>Job</th><th>Years</th>
    <th>Salary ($)</th></tr>

    </table>

    </tr>

    <tr>

    <td>

    <div id="Tabular1">

    <!-- The Recordset -->

    <table cellspacing="0" cellpadding="0" id="Recordset">

    <tbody>

    <COLGROUP>

    <col span="6" width="70">

    <col id="Co6">

    </COLGROUP>

    More HTML Articles
    More By Chrysanthus Forcha


       · The story lives on.Chrys
       · Hi,great article about making Tabular forms. Also is previous article about...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT