Tuesday, February 2, 2010

How to fix HTML table problem?

This is the most common problem that a web developer faces throughout his or her career. It is the table problem. Why is the text not aligned? Why is the image glued to the other end instead being centered? These are the common questions in mind especially when you have many layers of tables stacked up to each other.

There is a easy fix to this. COLOR IT!

But RULE#1 before this. Make a backup copy. When you have a copy backed up, you dare to do any experiment with it. Usually I will purposely do these:

<table bgcolor=red>...
<tr bgcolor=green>...
<td bgcolor=orange>...

You will see very clearly how your table or table row or table data behave in the browser. I usually run these experiments with IE, Firefox as well as Safari. However, it also depends on your DOCTYPE. Different DOCTYPE has different specification.

COLOR it! My friend. This is crucial especially when you are playing with WIDTH=100% game.

No comments:

Post a Comment