Align image in center inside a table cell ?

  • deepesh
  • Novice
  • Novice
  • deepesh
  • Posts: 30
  • Loc: INDIA

Post 3+ Months Ago

I am having a tough time aligning a image inside a table cell, the page is online at and the problematic table with pictures is below text "Hotel Pictures:":

Code: [ Select ]
http://www.mountabu.com/hotels/ashoka_hotel.html


please. help....
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Code: [ Select ]
<td align="center">

I think it would be better using CSS though ...
  • deepesh
  • Novice
  • Novice
  • deepesh
  • Posts: 30
  • Loc: INDIA

Post 3+ Months Ago

thanks for reply, but that is not working that is why I am here !
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8411
  • Loc: USA

Post 3+ Months Ago

how about...

Code: [ Select ]
<td valign="center">


I think that is what it should be.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

valign is for vertical alignment and not horizontal alignment

try this:
Code: [ Select ]
<td style="padding-left:20px;">

just change the 20px to suit whatever you need it to be ...
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8411
  • Loc: USA

Post 3+ Months Ago

If the above doesnt work (I'm almost certain the below wouldn't work also) try the below.

Code: [ Select ]
<tr align="center">
  • lajocar
  • Proficient
  • Proficient
  • User avatar
  • Posts: 272
  • Loc: South Africa

Post 3+ Months Ago

<p align="center"></p>
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

what is that going to help with aligning an image?
  • lajocar
  • Proficient
  • Proficient
  • User avatar
  • Posts: 272
  • Loc: South Africa

Post 3+ Months Ago

<table width="70%" border="1" cellspacing="7" cellpadding="7">
<tr>
<td align="center"><a href="ashoka/IMG_2623.JPG" rel="lightbox" title="Hotel Gallery"><img src="ashoka/gallery_thumb.JPG" alt="" width="107" height="160" /></a></td>
<td align="center"><a href="ashoka/IMG_2626.JPG" rel="lightbox" title="Bathroom"><img src="ashoka/bathroom_thumb.JPG" alt="" width="107" height="160" /></a></td>
<td align="center"><a href="ashoka/IMG_2625.JPG" rel="lightbox" title="Deluxe Room Sitting Area"><img src="ashoka/room2_thumb.JPG" alt="" width="107" height="160" /></a></td>
</tr>
<tr>
<td align="center"><a href="ashoka/IMG_2632.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room3_thumb.JPG" alt="" width="160" height="107" /></a></td>
<td align="center"><a href="ashoka/IMG_2637.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room4_thumb.JPG" alt="" width="160" height="107" /></a></td>
<td align="center"><a href="ashoka/IMG_2624.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room5_thumb.JPG" alt="" width="160" height="107" /></a></td>
</tr>
</table>
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8411
  • Loc: USA

Post 3+ Months Ago

righteous_trespasser wrote:
Code: [ Select ]
<td align="center">


I think it would be better using CSS though ...


deepesh wrote:
thanks for reply, but that is not working that is why I am here !


Doesn't work...

...and than...

lajocar wrote:
<table width="70%" border="1" cellspacing="7" cellpadding="7">

<tr>

<td align="center"><a href="ashoka/IMG_2623.JPG" rel="lightbox" title="Hotel Gallery"><img src="ashoka/gallery_thumb.JPG" alt="" width="107" height="160" /></a></td>

<td align="center"><a href="ashoka/IMG_2626.JPG" rel="lightbox" title="Bathroom"><img src="ashoka/bathroom_thumb.JPG" alt="" width="107" height="160" /></a></td>

<td align="center"><a href="ashoka/IMG_2625.JPG" rel="lightbox" title="Deluxe Room Sitting Area"><img src="ashoka/room2_thumb.JPG" alt="" width="107" height="160" /></a></td>

</tr>

<tr>

<td align="center"><a href="ashoka/IMG_2632.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room3_thumb.JPG" alt="" width="160" height="107" /></a></td>

<td align="center"><a href="ashoka/IMG_2637.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room4_thumb.JPG" alt="" width="160" height="107" /></a></td>

<td align="center"><a href="ashoka/IMG_2624.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room5_thumb.JPG" alt="" width="160" height="107" /></a></td>

</tr>

</table>


Lajocar, that doesn't work for him. That is why he is here :)
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

all right here is the code with the correct values aswell ...

Code: [ Select ]
<tr>
   <td style="padding-left:43px;"><a href="ashoka/IMG_2623.JPG" rel="lightbox" title="Hotel Gallery"><img src="ashoka/gallery_thumb.JPG" alt="" height="160" width="107"></a></td>
   <td style="padding-left:43px;"><a href="ashoka/IMG_2626.JPG" rel="lightbox" title="Bathroom"><img src="ashoka/bathroom_thumb.JPG" alt="" height="160" width="107"></a></td>
   <td style="padding-left:43px;"><a href="ashoka/IMG_2625.JPG" rel="lightbox" title="Deluxe Room Sitting Area"><img src="ashoka/room2_thumb.JPG" alt="" height="160" width="107"></a></td>
  </tr>
  <tr>
   <td style="padding-left:18px;"><a href="ashoka/IMG_2632.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room3_thumb.JPG" alt="" height="107" width="160"></a></td>
   <td style="padding-left:18px;"><a href="ashoka/IMG_2637.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room4_thumb.JPG" alt="" height="107" width="160"></a></td>
   <td style="padding-left:18px;"><a href="ashoka/IMG_2624.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room5_thumb.JPG" alt="" height="107" width="160"></a></td>
  </tr>
  1. <tr>
  2.    <td style="padding-left:43px;"><a href="ashoka/IMG_2623.JPG" rel="lightbox" title="Hotel Gallery"><img src="ashoka/gallery_thumb.JPG" alt="" height="160" width="107"></a></td>
  3.    <td style="padding-left:43px;"><a href="ashoka/IMG_2626.JPG" rel="lightbox" title="Bathroom"><img src="ashoka/bathroom_thumb.JPG" alt="" height="160" width="107"></a></td>
  4.    <td style="padding-left:43px;"><a href="ashoka/IMG_2625.JPG" rel="lightbox" title="Deluxe Room Sitting Area"><img src="ashoka/room2_thumb.JPG" alt="" height="160" width="107"></a></td>
  5.   </tr>
  6.   <tr>
  7.    <td style="padding-left:18px;"><a href="ashoka/IMG_2632.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room3_thumb.JPG" alt="" height="107" width="160"></a></td>
  8.    <td style="padding-left:18px;"><a href="ashoka/IMG_2637.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room4_thumb.JPG" alt="" height="107" width="160"></a></td>
  9.    <td style="padding-left:18px;"><a href="ashoka/IMG_2624.JPG" rel="lightbox" title="Deluxe Room"><img src="ashoka/room5_thumb.JPG" alt="" height="107" width="160"></a></td>
  10.   </tr>
  • deepesh
  • Novice
  • Novice
  • deepesh
  • Posts: 30
  • Loc: INDIA

Post 3+ Months Ago

Perfect, it worked :), thanks a lot, BTW any reason why the align="center" was not working?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8411
  • Loc: USA

Post 3+ Months Ago

No idea. I find it weird that it doesn't work since its more correct as far as development goes.

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 65 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.