#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    660
    Rep Power
    32

    Embedding swf causes weird padding on table cells?


    I made a 3 x 3 table that has 20px x 20px dimensions for each cell. Whenever I embed a 20px x 20px flash swf in each cell and give it width and height 20px, it adds a padding from somewhere.

    It makes my table too big and the layout off.

    What is causing this? Anyone know a solution?
  2. #2
  3. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,678
    Rep Power
    3164
    I'd check the CSS relating to however you have embedded the SWF file. Without more information it would just be endless guessing. When I embed a SWF I use swfobject2 with its dynamic method. That means I have a div tag with an associated CSS ID. Then in the stylesheet file I set the dimensions of the SWF div like:
    Code:
    #myContent
       {
          display: block;
          width: 20px;
          height: 20px;
          padding: 0;
          margin: 0;
       }
    Quis custodiet ipsos custodes?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    660
    Rep Power
    32
    Hey Tann, great to read from you!

    I ended up using
    object { display: block; }
    or
    creating a style for the div where my swf was embedded of line-height:0;

    I read on another website that object tags are treated as either inline or blocks. So you're solution would have worked since you mentioned display:block.

    Hope you are well mate, I thought you left the forum for a second

IMN logo majestic logo threadwatch logo seochat tools logo