www.webdeveloper.com
Results 1 to 6 of 6

Thread: cellpadding + cellspacing

  1. #1
    Join Date
    Jan 2003
    Location
    Philadelphia, PA
    Posts
    94

    cellpadding + cellspacing

    how do i set cellpadding+cellspacing in css?

    ...once i know the right css thing to set for it...if i put it in the body thing (like body {color: #123456}) will it change all the tables' cellpaddings and cellspacings?

    thanx,
    john

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    Table cellpadding and cellspacing are not CSS attributes, they are HTML attributes.

    If you set "padding" in the BODY, a table will not inherit that style, anyway. You can set "padding" on the TD or the TH.

    I'm not sure of the relationship of cellspacing and border-width + margin + padding, but I'm sure you could get it to look like you want it to look by playing with those style variables.

  3. #3
    Join Date
    Jan 2003
    Location
    Philadelphia, PA
    Posts
    94

    thanx

    thanx...i wasn't sure if it existed (i've never seen it)

    i just thought it would help tidy up my code...i could get rid of all those long "cellpadding=0 cellspacing=0" attributes in the 3 tables i have

    thanx again,
    john

  4. #4
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    Code:
    <style type="text/css">
    table
        {
        border-collapse: collapse;
        }
    td, th
        {
        margin: 0;
        padding: 0;
        }
    </style>
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  5. #5
    Join Date
    Jan 2003
    Location
    Philadelphia, PA
    Posts
    94

    mumbo jumbo

    Thanx!

    ...i didn't know you could change multiple tag's css by using the comma *takes a note*

    what's that collapse mumbo jumbo?

    p.s. what's your signature supposed to mean?
    Last edited by SearedIce; 04-14-2003 at 11:32 AM.

  6. #6
    Join Date
    May 2006
    Posts
    1

    Thanks!

    Id been looking for the solution posted by jeffmott for a while, it looks like the border-collapse function makes all the difference... just like the manual says

    from www.w3.org/
    The various border properties apply to columns only if 'border-collapse' is set to 'collapse' on the table element. In that case, borders set on columns and column groups are input to the conflict resolution algorithm that selects the border styles at every cell edge.
    This css made it for me (set cellpadding and cellspacing to 0 on all tables), whats the difference?

    table {
    border-collapse: collapse;
    margin: 0;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles