#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    17
    Rep Power
    0

    css: cellpadding, cellspacing, and my stupidity


    Hello all, I am encountering a minor bug working on a page, and it is driving me insane.

    Anyway, I have a table organized as such:

    <table height="100%" border="0" cellpadding="0" cellspacing="0">
    .
    .
    .
    </table>

    Now, I wanted to convert this to use CSS so that it would be HTML 4.01 compliant. So, I used a CSS document outlined like so:

    .maintable
    {
    padding: 0px;
    border-spacing: 0px;
    border: 0px;
    height: 100%;
    }

    and then changed my main code to this:

    <table class="maintable">
    .
    .
    .
    </table>

    Anyway, the height and border seem to be "moving over" fine, but it is clear to me that the padding and spacing are not. In any browsers that I use, I get an output as if padding and spacing were set to default values...

    I tried using the collapse method, that failed to.

    I usually miss minor things, so what is my stupid error?

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    205
    Rep Power
    12
    You'll want 'border-collapse', 'border-spacing', and 'empty-cells', in order to accomplish the same basic thing.

    Technically, border-collapse should override all the rest, but Mozilla doesn't seem to like that one as much. Likewise, IE (surprise) doesn't do the border-spacing' correctly. Using the three together, though, can achieve the same results in any browser.

    MPEDrummer
  4. #3
  5. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    Originally Posted by mpedrummer
    Technically, border-collapse should override all the rest, but Mozilla doesn't seem to like that one as much.
    can you elaborate that,
    can say i've seen any errors with mozilla and border-collapse,
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    17
    Rep Power
    0
    Originally Posted by mpedrummer
    You'll want 'border-collapse', 'border-spacing', and 'empty-cells', in order to accomplish the same basic thing.

    Technically, border-collapse should override all the rest, but Mozilla doesn't seem to like that one as much. Likewise, IE (surprise) doesn't do the border-spacing' correctly. Using the three together, though, can achieve the same results in any browser.

    MPEDrummer
    Thanks, I tried both of these, but they didn't seem to work either:

    Code:
    .maintable
    {
    	padding: 0px;
    	border-spacing: 0px;
    	border-collapse: separate;
    	empty-cells: hide;
    	border: 0px;
    	height: 100%;
    }
    and

    Code:
    .maintable
    {
    	padding: 0px;
    	border-spacing: 0px;
    	border-collapse: collapse;
    	empty-cells: hide;
    	border: 0px;
    	height: 100%;
    }
    Am I entering something wrong here?

    Thanks again
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    205
    Rep Power
    12
    I should have been more specific, I guess. NN6 ignores it completely, and so did Firefox. I generalized when I said Mozilla.

    Try 'empty-cells: show;' with the second example you posted, it should work.

    MPEDrummer

IMN logo majestic logo threadwatch logo seochat tools logo