Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > All Around Tutorials
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 06-23-2005, 06:33 AM
  #1
Horus_Kol
Mod of the Underlay
 
Horus_Kol's Avatar
 
Join Date: Jun 2002
Location: At a desk, hooked up and ready to rock
Posts: 17,509
iTrader: (0)
Horus_Kol is a glorious beacon of lightHorus_Kol is a glorious beacon of lightHorus_Kol is a glorious beacon of lightHorus_Kol is a glorious beacon of lightHorus_Kol is a glorious beacon of lightHorus_Kol is a glorious beacon of light
HTML 101: pt4 - Displaying Data - Tables and Lists

Part 3: Pulling it Together with Links

The original purpose of HTML was to combine the various data that were being churned out of the experiments at CERN (European Organization for Nuclear Research). It kind of grew a bit from those origins almost 20 years ago but, if you look close enough, you can see its roots.

Tables are one of the oldest elements available in HTML for laying out content – although this is no longer the standard way of doing it. Using CSS for layout design results in faster downloads and page-drawing on the client, and also for easier modification.

Still, tables are extremely useful if you actually have something that needs to be put into a table.

Simple Table

Code:
  <table>
    <tr>
      <th>
        Column Heading 1
      </th>
      <th>
        Column Heading 2
      </th>
    </tr>
    <tr>
      <td>
        Row 1, Column 1
      </td>
      <td>
        Row 1, Column 2
      </td>
    </tr>
    <tr>
      <td>
        Row 2, Column 1
      </td>
      <td>
        Row 2, Column 2
      </td>
    </tr>
  </table>
This will create a table that is 2 columns wide, and 2 rows long, and has column titles on the top.

Code:
 +------------------+------------------+
 | Column Heading 1 | Column Heading 2 |
 +------------------+------------------+
 | Row 1, Column 1  | Row 1, Column 2  |
 +------------------+------------------+
 | Row 2, Column 1  | Row 2, Column 2  |
 +------------------+------------------+
Simple enough….

Complex Layout

Now, say you want a layout like:

Code:
 +------------------+------------------+------------------+
 | Row 1, Column 1  | Row 1, Column 2  | This information |
 +------------------+------------------+ applies to both  |
 | Row 2, Column 1  | Row 2, Column 2  | rows             |
 +------------------+------------------+------------------+
Well, the following code would achieve it:

Code:
  <table>
    <tr>
      <td>
         Row 1, Column 1
      </td>
      <td>
         Row 1, Column 2
      </td>
      <td rowspan=’2’>
         This information applies to both rows
      </td>
    </tr>
    <tr>
      <td>
         Row 1, Column 1
      </td>
      <td>
         Row 1, Column 2
      </td>
    </tr>
  </table>
Notice how the second <tr> element only contains two <td> elements.

The rowspan attribute enables you to specify that a cell should take up multiple rows. Similarly, the colspan attribute works for columns.

The problem with tables is that the browser needs to first work out the size of the table and then draw it, and it is this which would slow down the drawing of the page if they were used for layouts.

Still, you do get the closest match between IE and Firefox (and Opera) when using tables with the least effort, and so you will find that many sites still rely on them for design.

If at all possible, avoid table layouts and only use them for actual data.

Lists

A lot of things come in lists – shopping, books, music tracks, instructions. Sometimes they have an order (a music top 40 for example), and sometimes they don’t (a set of items required for an activity).

HTML can handle both.

Chaos – Unordered Lists

If you happy enough to have no order (except that which you type in), then use the unordered list:

Code:
  <ul>
    <li>Unordered lists can be used as bullet points for listing attributes</li>
    <li>OR properties</li>
    <li>OR links to other websites</li>
  </ul>
And of course, a lot more besides.

Order Lists

Code:
  <ol>
    <li>This would be number 1 in the list</li>
    <li>And this would be number 2</li>
  </ol>
By default, ordered lists are numbered with Arabic number (0-9). However, there are some CSS style properties that can be used to change this – you can have roman numerals, letters, and so on.

Lists of Lists

You can even have lists of lists:

Code:
  <ol>
    <li>
      <ul>
        <li>This is bullet within item 1</li>
        <li>Another bullet</li>
      </ul>
    </li>
    <li>
      Item 2 has bullets because it is simpler
    </li>
  </ol>
Or list of lists of lists of lists of lists of lists of lists….

Sorry, got carried away there.

The next tutorial will cover the use of structured text elements to describe information on your page…

Part 5: Structured Text
__________________
Photo Gallery: Modus InOperandi
Articles on Programming and Development (PHP/HTML/CSS, C/C++, more): RandomTweak
Mystery Website

Last edited by Horus_Kol : 06-23-2005 at 09:03 AM.
Horus_Kol is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-19-2009, 12:28 PM
  #2
bigcat1967
Paladin (Level 15)
 
Join Date: Mar 2009
Posts: 391
iTrader: (0)
bigcat1967 is an unknown quantity at this point
That's cool to know tables - but for SEO reasons, wouldn't be better to have sites that are tableless? - just go with CSS containers? Just a thought - that way, it will give bots an easier time to chew info.
bigcat1967 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 03:24 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.