Alternative to White Space and Images

Tweak

The Weedman
Joined
11 Apr 2004
Messages
39
I was wondering if anyone knew a way to avoid the troublesome problems involving tables, whitespace, and images. What I mean is if you make a cell with an image in it and you include any whitespace from the tag to the image itself, it adds that whitespace. That means that you can't use indents to format the code nicely. I was wondering if anyone knows a way around this problem or if I'm stuck without any tabs forever.
 

Widescreen

Noobie ;)
Joined
4 Apr 2004
Messages
5
the easiest way is to make the table the same size as the background image or the image the same size as the table

eg:
Code:
<table width="100" 
height="333"  border="0" 
cellpadding="0" cellspacing="0" 
background="images/menu.gif">
 

Tweak

The Weedman
Joined
11 Apr 2004
Messages
39
Well the problem with that is sometimes IE doesn't listen to the attributes of the tables. I hate MS for that. They are lazy and they don't even listen to all the code you put in your file. Background images do work sometimes but honestly I think its pathetic that no one can create a browser that actually works right. I mean we are talking people who are paid thousands and they still **** it up.
 

ignipotentis

OSNN Addict
Joined
25 Mar 2004
Messages
127
You can use whitespace. HTML doesn't care about white space. The biggest problem is that most people do not create their tables correctly.

On a side note, I suggest you stop using tables for formatting. Learn CSS.
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
ignipotentis said:
On a side note, I suggest you stop using tables for formatting. Learn CSS.
Yep it is better to use CSS positioning instead of using tables for layout control, but dont forget about tables, there is no point using CSS for showing clearly tabular data if you use the tables properly.

Also just cause I had it drilled into me by my lecturers make sure you have valid code
http://validator.w3.org/
I still dont know why, but I often take a look at the HTML source of most sites just to see if they look like they are using valid code, and on a few occasions I have emailed the webmaster if the site is majorly broken in a browser other than MSIE
 

Tweak

The Weedman
Joined
11 Apr 2004
Messages
39
ignipotentis said:
You can use whitespace. HTML doesn't care about white space. The biggest problem is that most people do not create their tables correctly.

Well it does care about whitespace on IE. Thats the thing there is no way around it. You can search the web for people bitching and moaning about this and there isn't a solution as far as I can see. Whitespace affects tables even when done right trust me. I code everything by hand and stay away from nested tables with spacer images, etc. IE interprets white space wrong end of story.

CSS I do know but isn't a solution for what I'm doing sorry.
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
could you use CSS to control the image margins and padding? or maybe the cell margins and padding?
how are you doing your indents? 2 space or tab?
 

Tweak

The Weedman
Joined
11 Apr 2004
Messages
39
Ya but that doesn't matter. I mean HTML is only what the browser makes its. In a perfect world HTML would be listened to and whitespace wouldn't be payed attention to but obviously that isn't the case.
 

Members online

No members online now.

Latest profile posts

Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,411
Members
5,590
Latest member
miankafir