SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    WebAmoeba mythix's Avatar
    Join Date
    Aug 2002
    Location
    here
    Posts
    578
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Send varaibales to css? and cuase backgrounds to apply to entire cells???

    Hi,

    I've got a slight problem, i've got three styles that i need to apply to one table cell, I started off by having one class in the td tag and then made up two span tags with the other classes in.

    However this didn't display properly becasue two of the styles apply settings to the table cell, one gives a background colour the other gives a border.

    If i get the border where I want it, it has to go in the table cell class attribute, however so does the class that applies a background. cos if you whack it in in a span tag it only covers the content of the cell and not the entire cell background.

    does anyone know a way around this??? how can I make the backhground apply to the entire cell???

    I also have a load of css styles in the format .line[t][r][b][l], where top/right/bottom/left. Is it possible to setup a single style called line that causes the lines to appear in the positions as sent by the name, i.e. a topline where linet, or a top and bottom line where linetb???

    Thanks
    Laws are like sausages. You have much more respect for them if you haven't actually seen how they're made.

    http://www.webamoeba.co.uk

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand you correctly, you want different borders depending on where in the table the cell is?
    I think you have to define 4 (or maybe 9?) different classes

    An alternative is to set the common properties (bg colour etc) for the <td>s with a css class, and then use a little javascript that loops through the cells and sets the individual border properties, depending on where in the table the cell is located?

  3. #3
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, all combinations, like l, t, r, b, lt, lr, lb, tr, tb, rb, ltr, ltb, lrb, trb, ltrb ... that's 15 classes, not 9, of course...

  4. #4
    WebAmoeba mythix's Avatar
    Join Date
    Aug 2002
    Location
    here
    Posts
    578
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    15 classes, cor your really good at maths

    I have found a way around the current problem. I have changed the names of the ones that make bgcolours to td#somecolour, that way i could set the id and a class and have two classes applied to one cel, yay!

    Still, dynamic css, now there's a concept.
    Laws are like sausages. You have much more respect for them if you haven't actually seen how they're made.

    http://www.webamoeba.co.uk


Bookmarks

Posting Permissions

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