Thursday, June 14, 2007

  in HTML

The world is a funny place, full of funny people, who do funny things.

I remember at one point in my programming career, I used to worry more about how to get a task done, given what I knew at that point. Now I worry more about knowing the correct way to complete a task.

Here is a funny example of someone trying to get a task done given what they currently know, instead of figuring out the right way to do it:
samsonasu:
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;</td>
samsonasu: thats such shitty code
Though one "&nbsp;" is often good in HTML, using them to achieve your desired spacing is HORRIBLY GHETTO :-p. If you do this, and want to know a better alternative, try either using a spacer image (a 1x1 transparent gif), with a width and height, or better yet using the padding-left or margin-left css attributes.

Thanks for this one Samson :-p And Happy HTML'n to the rest of you.

1 comment:

Brian Samson said...

By the way I changed that horrible line to:

<td style="width: 72px"/>

and it looks exactly the same. That table doesn't have a border, and that cell is just a spacer.