Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post

    <col> style in mozilla

    i'm trying to assign some styling to col's in a table. it's working just as i'd expected in IE, but it's not working at all in moz. here's a mock up of what i've got ( this isn't online yet, or i'd link to it ):

    <table id="content" border="0" cellpadding="0" cellspacing="0" columns="4">
    <colgroup>
    <col id="left" />
    <col span="2" />
    <col id="right" />
    </colgroup>
    <tr height="100">
    <td>column 2</td>
    <td>column 2</td>
    <td>column 3</td>
    <td>column 4</td>
    </tr>
    <tr height="100">
    <td>column 1</td>
    <td colspan="2">column 2</td>
    <td>column 3</td>
    </tr>
    <tr height="100">
    <td>column 2</td>
    <td>column 2</td>
    <td>column 3</td>
    <td>column 4</td>
    </tr>
    </table>

    and in my style sheet, i've got this:

    #left {
    background: url("../beta/left.gif") repeat-y;
    background-position: left top;
    width: 100px;
    }

    #right {
    background: url("../beta/right.gif") repeat-y;
    background-position: right top;
    width: 100px;
    }
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When I replaced the <col span="2"> it looked better. But still, for a strange reason the background image doesn't show in Mozilla.
    I never used col groups, but according to DevGuru, background-image is not part of the attributes for col group. Maybe it's that. Not supported?
    http://www.devguru.com/Technologies/..._colgroup.html

    <colgroup>
    <col id="left" />
    <col span="2" />
    <col id="right" />
    </colgroup>

    <colgroup>
    <col id="left" />
    <col id="" />
    <col id="" />
    <col id="right" />
    </colgroup>

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    an interesting observation, and that's probably the problem, but i have to wonder then, how'm i supposed to assign the same background to an entire column, without hitting each cell? any ideas?

    also, i've gotta wonder, why am i allowed to assign <col>s style attributes, if they're not going to be displayed?
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    tr > td:nth-child(even) {
    background: white;
    }
    tr > td:nth-child(odd) {
    background: gray;
    }

    The (future) joys of CSS3...

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Every tutorial on the web has pages about <col> and <colgroup>. They all say: "Supported by version 4 browsers and up". Yet it looks like IE is the only browser supporting the style attribute. Can't get it to work in any version of NN, Opera or Mozilla.

  • #6
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    so what you're saying, is that there's nothing wrong with my code, but rather, IE is the only one that's getting this right?

    ::sigh::

    that means 1) i have to assign every cell a background image, in order to get this cross browser. ::shakes fist-o-anger at the gods of compatability:: , and 2) i have to file a bug report with mozilla.

    oh well. thanks for confirming my fears, MCookie.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •