SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot yacka's Avatar
    Join Date
    Aug 2006
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Styling table cells in xhtml

    I've been experimenting with various table styles, including use of the html cellspacing attribute. It appears there are basically three cell border styles:

    1) Allow all the cell borders to collapse together, although this intentionally causes some borders to appear superimposed on others. Most of the time this doesn't matter but it doesn't look great if you have different color cell borders.

    2) Allow all the table cells to be seperated by the default cellspacing (or border-spacing).

    3) Set cellspacing to 0 to allow all borders to sit flush with no spacing.

    I am focusing on IE6, which reportedly does not support border-spacing. Is it possible to get the third option without without using cellspacing? Is it ok to use cellspacing in xhtml? It validates but it doesn't feel correct.
    Coding for Clarity - A Programmers Style Guide

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It is fine to use cellspacing and M$IE does not understand 'border-spacing'.

  3. #3
    SitePoint Zealot yacka's Avatar
    Join Date
    Aug 2006
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks xhtmlcoder. It's a pity I can't do option 3 strictly in CSS because it makes the styling process inconsistent. I have to apply the cellspacing to each and every table rather than a single stylesheet. What a pain.
    Coding for Clarity - A Programmers Style Guide


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
  •