CSS - cellpadding and cellspacing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Seth Watson

    CSS - cellpadding and cellspacing

    I've seen so many answers on the net I am not sure which one is right or if
    there's one answer that will work in all browsers

    First off - Table - cellspacing and cellpadding

    What is the CSS equivalent for each?
    Is this also cross browser compatible?


    ** Posted from http://www.teranews.com **
  • dorayme

    #2
    Re: CSS - cellpadding and cellspacing

    In article <9c123$490e7848 $7695@news.tera news.com>,
    "Seth Watson" <what43@yahoo.c omwrote:
    I've seen so many answers on the net I am not sure which one is right or if
    there's one answer that will work in all browsers
    >
    First off - Table - cellspacing and cellpadding
    >
    What is the CSS equivalent for each?
    Is this also cross browser compatible?
    >
    I get by with like:

    td {padding: .3em; border: 1px solid black;}
    table {border-collapse: collapse;}

    --
    dorayme

    Comment

    • Ben C

      #3
      Re: CSS - cellpadding and cellspacing

      On 2008-11-03, Seth Watson <what43@yahoo.c omwrote:
      I've seen so many answers on the net I am not sure which one is right or if
      there's one answer that will work in all browsers
      >
      First off - Table - cellspacing and cellpadding
      >
      What is the CSS equivalent for each?
      cellspacing: border-spacing
      cellpadding: set padding on the td

      e.g.

      <table cellspacing=4 cellpadding=5>

      works the same as:

      table {border-spacing: 4px}
      td {padding: 5px}
      Is this also cross browser compatible?
      It works in all the main browsers, but you'll have to test it in IE to
      be sure.

      Comment

      • dorayme

        #4
        Re: CSS - cellpadding and cellspacing

        In article <slrnggtf8i.4m2 .spamspam@bowse r.marioworld>,
        Ben C <spamspam@spam. eggswrote:
        On 2008-11-03, Seth Watson <what43@yahoo.c omwrote:
        I've seen so many answers on the net I am not sure which one is right or if
        there's one answer that will work in all browsers

        First off - Table - cellspacing and cellpadding

        What is the CSS equivalent for each?
        >
        cellspacing: border-spacing
        cellpadding: set padding on the td
        >
        e.g.
        >
        <table cellspacing=4 cellpadding=5>
        >
        works the same as:
        >
        table {border-spacing: 4px}
        td {padding: 5px}
        >
        Is this also cross browser compatible?
        >
        It works in all the main browsers, but you'll have to test it in IE to
        be sure.
        border-spacing does not work in IE6. There is nothing much wrong, of
        course, with using cellspacing where you need such. There are many
        practical solutions to problems that arise where you might want
        cellspacing but be hell-bent on pure markup without anything but basic
        (default) presentation. But we would need a case or two to play with.

        --
        dorayme

        Comment

        Working...