Creating tables, rows and columns when you make website

Tables are useful when you make your own web site. Apart from displaying information in a nice spreadsheet like structure. It can also be used to align your web site layout. However the over use of tables for web site alignment is frowned upon as it mean bad programming practice.

As a lay user, we are not expert programmers. We may end up using programs like Dreamweaver, Frontpage or similar software to build our web sites. However I did notice that Dreamweaver is also not a follower of good programming practices when it comes to aligning the various web page block sections, it overuses tables to create spacing and margins. So if you are part software user, part programmer, you would definitely knock your head on the wall when you try to edit the HTML codes directly after initially using Dreamweaver to create the overall page structure.

Using tables to align sections is a lot easier than using CSS. Though the current web page developer convention is to use CSS to align each block accordingly to each block section of the web page. I’ll leave that kind of coding to the experts. For me, I’ll use a simple table set up to get each block section into exactly where I want them to be and for the rest of the layout and design, I use CSS.


Tables uses three sets of HTML codes, namely <table> – to tell the browser you are starting a table, <tr> – to create a table row, and <td> – to create a table column.

Let’s say we create a simple 4×4 table, we will code it out as:

<table>

<tr><td>1</td><td>2</td></tr>

<tr><td>3</td><td>4</td></tr>

</table>

And we will get:

1 2
3 4

And to get something more complicated like a header in the table that spans across two or more column we use the colspan=”x” in the td tag. So let’s create a 5×4 with a header row:

<table>

<tr><td colspan=”2″>Header</td></tr>

<tr><td>1</td><td>2</td></tr>

<tr><td>3</td><td>4</td></tr>

</table>

And we get:

Header
1 2
3 4

And finally to make the table border lines invisible, we use border=”0″ in the table tags itself.

<table border=”0″>

Another important code to know is cellspacing=”x”. This is used to control the gap between the cells. This code is important to know because CSS code cannot control the gap between cells, especially if you want to remove the gap in between. To remove the gap, use cellspacing=”0″:

<table border=”0″ cellspacing=”0″>

That’s the basics of making tables using HTML when you make your own web site.

More related HTML tutorials

Tags: , , , ,

Leave a Reply

Google  Site Search for JanLeow.com

Recent Posts

  1. Finally installed Windows 7
  2. Google Webmaster Central DNS Verification Method
  3. Leow surname history
  4. Colic in Infants and Colic Cure
  5. Baby Night Out
  6. My Desktop Computer Becoming Slower, Time to Reformat
  7. Careful about Email Spoofing
  8. Jaundice in newborns and Jaundice treatment
  9. Jhoos dating messenger scam site
  10. Build a better mouse trap and customers will beat a path to you
  11. Important To Back Up My PC
  12. Pos Malaysia Postal Rates July 2010
  13. Cure for Boils
  14. How to switch off Bing background
  15. Words of Inspiration Quotes on Confidence


  Jan's Personal Blogs at Blogged

Jan's blogs about life

↑ Grab this Headline Animator

Subscribe To
This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Add to Newsgator
Subscribe with Bloglines RSS update via Email

Enter your email address:

RSS Delivered by FeedBurner