Results 1 to 5 of 5

Thread: centre iframe within a simple table

  1. #1
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question centre iframe within a simple table

    Hello all,

    I'm trying to centre the iframe containing the facebook app on my website inside a simple table. I've scanned through a few internet pages and tried the suggestions ( including one on here from last year ) but nothing seems to shift it from it's left hand margin.

    The website is:

    www.pwcircuits.co.uk

    and it's the group of social button at the bottom left, you'll see the pesky facebook.

    Any help would be gratefully received !

    Thanks.
    Last edited by jscheuer1; 08-08-2012 at 01:30 PM. Reason: Format

  2. #2
    Join Date
    Jul 2012
    Posts
    44
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    The easiest way is to center the <td> it is in.
    <td align="center">

    If more stuff is in the same <td>, split it into its own table division and center that.

    That's provided the iFrame is only as wide as the icons. If it's 100% width of the outer cell or something, size down the iFrame and it will center.

    I didn't look at your code, so I hope that helps.
    Last edited by williamsun; 08-08-2012 at 10:05 PM.

  3. #3
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question

    Hmm tried that but coudn't seem to get it to shift, the iframe size is the same as the facebook icon ( i think ) and is smaller that the frame. might need someone to quickly scan that part of the code to point out where i'm going wrong?

  4. #4
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Try adding style="margin:auto;" to the problematic iframe or style="text-align:center;" to it's parent tag.


    Tables for content layout
    From the looks of your website, you're using tables for the layout of your content.
    Tables can only be used for tabular data! Using tables for layout is depricated by all modern standards!
    The correct way to program the layout of your site is using css and divs.
    Using tables can bring about a whole pile of problems for your site.
    You should never use tables for layout.




    Also around line 350, there is this -
    Code:
    <p ALIGN=center>
    However all your other tags are lowercase. One of the main things to try and keep to is consistancy!
    (P.s. You should never use uppercase tags anyway)


    Also, you're using font tags; in modern standards they're depricated.
    You have to use <tag style=""></tag> where tag is the tag of your choice (I normally use span tags to do what a font tag would do).

    At least you're not using <center> tags!
    Last edited by keyboard; 08-16-2012 at 12:54 AM.

  5. The Following User Says Thank You to keyboard For This Useful Post:

    pwcircuits (08-16-2012)

  6. #5
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks for the reply and help but it doesn't shift.

    Your right of course with the tables, I'm only a amateur web builder - the design was from a pre brought template, but I finding the site now starting to 'creak' a little under all the changes to html etc ....., but it's having the time & knowledge to update it.

    Think I'll just live with it not lining up for the mo, I'm sure potential customers aren't going to be put off buying from us because the Facebook logo isn't centred

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
  •