🐿️
-1

Pro tip: Stop using spacer gifs to force layout gaps in tables

I keep seeing people on old Angelfire sites use a 1x1 transparent pixel to push columns apart, but it breaks when you resize the browser window. Why not just set the cellpadding properly in your table code instead?
2 comments

Log in to join the discussion

Log In
2 Comments
paulc93
paulc939d ago
Wait, are you serious? People actually coded whole sites using a transparent pixel as a spacer? I mean I know the old table layout days were wild but that is next level janky. Cellpadding and cellspacing exist for a reason, right? Like you could just set a 10 pixel gap in your table tag and not have to worry about some invisible image throwing everything off when the browser window shrinks. What did they do when somebody turned off images in their settings?
2
thompson.christopher
Used to think cellpadding and cellspacing fixed everything too, but then I tried making a pixel perfect layout in Outlook 2003. That's when I got why the spacer gif was a thing. Email clients ignored half the CSS and the table properties you set, but they'd render a 1x1 pixel image scaled to whatever size you needed. It was less about being clever and more about fighting broken rendering engines. If someone turned off images, yeah the layout would break, but most folks back then didn't bother with that setting. Looking back it was ridiculous, but at the time it was the only way to get consistent spacing across browsers and email clients.
1