Alternative to White Space and Images

Discussion in 'Web Design & Coding' started by Tweak, Apr 12, 2004.

  1. Tweak

    Tweak The Weedman

    Messages:
    39
    Location:
    Moscow, ID, USA
    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.
     
  2. Widescreen

    Widescreen Noobie ;)

    Messages:
    5
    Location:
    Leicester UK
    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">
     
  3. Tweak

    Tweak The Weedman

    Messages:
    39
    Location:
    Moscow, ID, USA
    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.
     
  4. ignipotentis

    ignipotentis OSNN Addict

    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.
     
  5. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    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
     
  6. Tweak

    Tweak The Weedman

    Messages:
    39
    Location:
    Moscow, ID, USA
    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.
     
  7. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    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?
     
  8. ignipotentis

    ignipotentis OSNN Addict

    Messages:
    127
    This may be so, but I clearly said HTML doesn't care about white space
    :) .
     
  9. Tweak

    Tweak The Weedman

    Messages:
    39
    Location:
    Moscow, ID, USA
    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.