Feb
04
Every day it seems more and more web developers seem to think that tables should not be used. Instead all we see now a days is style=”float: left” or style=”float:right”, even when all the developer is trying to do is create columns. Why do we need to complicate things. If you are creating multiple columns then use a table that is what it’s purpose is, and to top it off you don’t have to worry about how to clear your floats appropriately. For those that need a refresher course below is the basic structure for a 2 column table with its content vertical aligned at the top and not center of the column…
<table border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <!-- content for left column --> </td> <td valign="top"> <!-- content for right column --> </td> </tr> </table>
Now the next time you find yourself using floats, take a deep breadth and ask yourself should I be using a table for this?
no comment untill now