SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TABLE > TD padding

    Im getting a padding effect (padding set to 0) for a TD element when viewed in firefox but not when in IE ??

    Is this a bug in firefox ??

  2. #2
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That's impossible to say without seing your code.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  3. #3
    SitePoint Member
    Join Date
    Feb 2006
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <table width="600" border="0" cellspacing="0" cellpadding="0"  style="border: 1px solid #ccc; border-top: none; border-bottom: none;">
              <tr>
                <td width="389" align="left" valign="top" style="padding-left: 10px; padding-right: 10px;font-family:Arial; font-size: 12px;"><p>Dear Mr spaz</p>
                  <h2 style="font-size: 31px; color: #003399;">Thank you for your application</h2>
                  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sagittis arcu id felis facilisis id aliquet nunc molestie. </p>
                  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sagittis arcu id felis facilisis id aliquet nunc molestie.  </p>
                  <h3 style="font-size: 12px; color: #003399;">Donec sagittis arcu id felis facilisis</h3>
               
               </td>
                <td valign="top" ><a href="#"><img src="images/image.jpg" width="210" height="407" alt="image" /></a></td>
              </tr>
            </table>

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    You have the left and right padding set to ten pixels in the first td.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  5. #5
    SitePoint Member
    Join Date
    Feb 2006
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I know but I talking about the top and bottom.

  6. #6
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Can you post a screenshot from both Internet Explorer and Firefox?
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  7. #7
    SitePoint Member
    Join Date
    Feb 2006
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Attched image has guides to show 12px padding at the top in left firefox render.

    bug.jpg

  8. #8
    SitePoint Member
    Join Date
    Feb 2006
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone have a suggestion to the cause of the faux padding ??

  9. #9
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Doesn't look like tabular data, the BORDER, CELLPADDING, and WIDTH attributes have no business in ANY HTML written after 2001ish (when we kicked netscape 4 to the curb) -- and you're declaring so much CONFLICTING CSS (that also shouldn't be in the markup) I'd be surprised if any two browsers rendered that the same way.

    I'd have to see it live on a page to comment further -- though I suspect the real answer is to lose the table altogether... I also question the element you put the H2 on -- and I VERY much doubt that the bit you have as a H3 is in fact a heading -- aka the start of a new subsection! (Lemme guess, choosing your HTML tags based on their default appearance?)

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,288
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    It looks like the default top margin on the p element.

    Try this:
    Code:
    p{margin:0 0 1em}
    Some browsers apply top and bottom margins and some like IE apply only a bottom margin so you need to explicitly control it.

  11. #11
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I agree with Paul on the source, but I also agree that this shouldn't be in a table in the first place. You can create the same effect much more easily and with less mark-up using CSS.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!


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
  •