SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Member ngaisteve1's Avatar
    Join Date
    May 2003
    Location
    Kuala Lumpur, Malaysia (Boleh!)
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to css this?

    I have a table property like below

    <table cellpadding="0" cellspacing="0">

    How do I css this property so that I can maintain it easily in the future? Thanks.

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Member ngaisteve1's Avatar
    Join Date
    May 2003
    Location
    Kuala Lumpur, Malaysia (Boleh!)
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I changed my css, it becomes better but still got a little tiny space.

    My external css, I put:

    table#frame_main
    {
    border-collapse: collapse;
    }

    td#frame_main2
    {
    padding: 0px;
    }

    My html I have
    <table id=frame_main>
    <tr><td>
    </td></tr>
    <tr><td id=frame_main2><!--#include file="inc_menu.asp"--></td></tr>

    How do I fix this? Thanks.

    My link is http://recruit.mnetrade.com/home.asp

  4. #4
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried to set the margins to 0px as well?

    margin: 0px;

    Also, as far as I know, you need to use double quotes like this:

    <table id="frame_main">

    Have you thought about using <div> tags instead of table?
    That way your code would be much more accessible and clean.

  5. #5
    Member ngaisteve1's Avatar
    Join Date
    May 2003
    Location
    Kuala Lumpur, Malaysia (Boleh!)
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I changed to

    table#frame_main
    {
    border-collapse: collapse;
    margin: 0px;
    }

    td#frame_main2
    {
    padding: 0px;
    margin: 0px;
    }

    and put "" but the result is still the same. Any more other possibility? Thanks.

  6. #6
    SitePoint Addict trigger's Avatar
    Join Date
    Jun 2003
    Location
    Eagan
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. where you have the margin: 0px; ---- take out the "px" in the css, you don't need it
    2. try using, display: properties, for example, for the table, use display: table, and td use display: table-cell;
    3. check on the validity and/or need of the border-collapse
    4. looking at your link, I see this terrible line
    Code:
    <tr><td id=frame_main2><table id=menu cellspacing=0 cellpadding=0>
    , so you have an embedded table....ugh, I would never suggest that, but get rid of the cellspacing and cellpadding values if you want to go css (as well as the valign properties), plus you should have for the table id="menu" instead
    5. A quick fix might be to put
    Code:
    *{padding:0; margin:0; }
    at the top of your css to elinate all default browser margin and padding values, but you have to manually set for everything then...
    Not another drugstore, not another town
    Tired of the overdrop, I had to put it down
    You know I was the man when I put the Crown down
    Then rolled around the Chemicals to pave the New Sound

  7. #7
    Member ngaisteve1's Avatar
    Join Date
    May 2003
    Location
    Kuala Lumpur, Malaysia (Boleh!)
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a lot of point, Trigger. Thanks.

    Point 1
    I have get rid the px.

    Point 2
    Not too understand but will search google to find out.

    Point 3
    Yeah, I have tested it. It works.

    Point 4
    since only border-collapse (cellspacing) works only for css at the moment, so I thought of using that cellspacing=0 cellpadding=0 in my table. Besides, it is ok because that is an asp include file. i use id=menu for other purposes like height and weight

    Point 5
    Not too understand. Is it putting it in my mystyle.css?

  8. #8
    SitePoint Addict trigger's Avatar
    Join Date
    Jun 2003
    Location
    Eagan
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One more suggestion
    1. where you have "table#menu" in mystyles.css, try putting in #menu table instead. When I switched that up, it changed some of the display properties.

    Yeah for the #menu table properities, try specifically assigning display properties and see what it does. I see that you've inserted the *{padding:0; margin:0; } property, hopefully that does some of what you want. Under point 4, assigning cellpadding and cellspacing to tables isn't valid code according to most, and I used to have styled tables, styled through the table tag instead of css, and fixing is now a huge pain, just so you know.

    p.s. make sure to make a doctype declaration in your html file
    http://www.alistapart.com/articles/doctype/
    Not another drugstore, not another town
    Tired of the overdrop, I had to put it down
    You know I was the man when I put the Crown down
    Then rolled around the Chemicals to pave the New Sound


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
  •