align images in center html - help

Discussion in 'HTML & Website Design' started by csdname, Mar 10, 2010.

  1. #1
    I'm trying to align 3 images in the center of a td tag. I use a table inside the td tag with the th align=center but it don't works.
    I need help with this.


    <table cellspacing="0" cellpadding="0" border="0">
    <tr>
    <td><img src="/images/infobox/upper_left.gif" border="0"></td>
    <td class="mws_boxTop" width="100%"><a href="http://www.domain.com" TARGET='_blank'>fggfg</a> - fgfgfg</td>
    <td><img src="/images/infobox/upper_right.gif" border="0"></td>
    </tr>
    <tr>
    <td class="mws_boxLeft"></td>

    <td class="mws_boxCenter">
    <table>
    <tr>
    <TH ALIGN="CENTER"><a href="page1.html" TARGET='_blank'><img src="1-t1.jpg" border="0"></a></TH>
    <TH ALIGN="CENTER"><a href="page2.html" TARGET='_blank'><img src="2-t1.jpg" border="0" ></a></TH>
    <TH ALIGN="CENTER"><a href="page2.html" TARGET='_blank'><img src="3-t1.jpg" border="0"></a></TH>
    </tr>
    </table>
    </td>


    <td class="mws_boxRight"></td>
    </tr>
    <tr>
    <td><img src="/images/infobox/lower_left.gif" border="0"></td>
    <td class="mws_boxBottom"></td>
    <td><img src="/images/infobox/lower_right.gif" border="0"></td>
    </tr>
    </table>






    Thanks ;)
     
    csdname, Mar 10, 2010 IP
  2. jonmaster

    jonmaster Peon

    Messages:
    181
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    may this class is causing any problem

    <td class="mws_boxCenter">

    you can remove mws_boxcenter class and try. and

    you can also try like this

    <tr><th align="center" valign="middle"></th></tr>
     
    jonmaster, Mar 10, 2010 IP
  3. ampg-it

    ampg-it Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try this

    <table align="center">
    <tr>
    <TH><a href="page1.html" TARGET='_blank'><img src="1-t1.jpg" border="0"></a></TH>
    <TH><a href="page2.html" TARGET='_blank'><img src="2-t1.jpg" border="0" ></a></TH>
    <TH><a href="page2.html" TARGET='_blank'><img src="3-t1.jpg" border="0"></a></TH>
    </tr>
    </table>
     
    ampg-it, Mar 11, 2010 IP
  4. typingmums

    typingmums Well-Known Member

    Messages:
    1,446
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Try this:

    <td><div align="center"><a href="page1.html" TARGET='_blank'><img src="1-t1.jpg" border="0"></a></div></td>
     
    typingmums, Mar 11, 2010 IP
  5. pjamesmg

    pjamesmg Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    The div align code should work.
     
    pjamesmg, Mar 12, 2010 IP
  6. csdname

    csdname Well-Known Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #6
    Hi.
    Thank you all.
    I have it working... ;)
     
    csdname, Mar 12, 2010 IP
  7. spy100

    spy100 Well-Known Member

    Messages:
    689
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    108
    #7
    use css it will make your life more easy
     
    spy100, Mar 18, 2010 IP
  8. seosuperman

    seosuperman Peon

    Messages:
    85
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    CSS is the future of design and I highly agree it makes your life a lot simpler
     
    seosuperman, Mar 18, 2010 IP
  9. faraz01

    faraz01 Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Last days i had face the problem like this.I got the solution from this discussion So Thanks a lot For this Sharing.
     
    faraz01, Mar 18, 2010 IP
  10. softworks-workforce

    softworks-workforce Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    softworks-workforce, Mar 19, 2010 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #11
    Uhm, without seeing the images or CSS you were applying everything said or going to be said is a wild stab in the dark - BUT...

    Why do I smell tables for layout? I have the sneaking suspicion what you are trying to do could be done with one heck of a lot less code without the tables... Are those images in fact tabular data?

    Your HTML is just sending up warning flags that made me have to ask that, since in MODERN coding practices there is no align attribute, no border attribute, and no target attribute... Which immediately begs the question is this even tabular data or are we just looking at table abuse? That it's a dual nesting of table is a high indicator that something's not kosher... I'm seeing decade or more out of date code - so I have to wonder if the entire approach you are trying to use is even appropriate.
     
    deathshadow, Mar 19, 2010 IP