PDA

View Full Version : html alignment question?


PuntoPower
Fri 16th Apr '04, 3:12pm
hi

my problem is that i want to align a pic, a table and a pic on the same line centerally on my vb3 forum homepage. what is happening at the moment is that the pic, table and pic are on seperate lines but are centered. plz help. here is the code so far.

$randompic are a variable that was setup which contains a random image from the gallery. it basically contains this. the images are 133x100 if that any help or not.



<a href=http://www.mysite.com/gallery/displayimage.php?pos=-903></a><a href="http://www.mysite.com/gallery/displayimage.php?pos=-903"><img src="http://www.mysite.com/gallery/albums/userpics/100_modified_cars/thumb_IMG_1992.JPG" border="0" vspace="5" hspace="5" ></a>









<p align=center>
$randompic1
<table cellpadding="4" cellspacing="1" border="0" width="40%" bgcolor="#000000">
<tr>
<td width="100%" bgcolor="#3E5C92"><div align="center"><b><font size="2" color="#FFFFFF">Who's in RacersHaven Chat Room</font></b></div>
</td />
</tr />
<tr>
<td valign bordercolor="#333333"" bgcolor="#E1E4F2""top><div align="center"><a href="http://www.mysite.com/chat/chat/index.php3" target="_blank">Chatroom</a></div></td>
</tr>
<tr>
<td width="100%" valign bordercolor="#222222"" bgcolor="#F5F5FF""top>
<table width="95%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#F5F5FF" bgcolor="#F5F5FF">
<div align="left"> <span class="smallfont"> $chatters </span> </div>
</table>
</td>
</tr>
</table>
$randompic2
</p>

Floris
Sat 17th Apr '04, 6:53am
Your xhtml code is quite messy, but besides that it is all on a different line because you use <p>.

Make a new table with 1 row, 3 columns.
In the left, you put your left random picture.
In the middle, your <table> code.
In the right, you put your right random picture.

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>leftimg</td>
<td>your table code</td>
<td>rightimg</td>
</tr>
</table>

The first portion code you paste here won't work properly because you have nothing in between the tags.

<a href="link">{empty!!}</a>
If you want to link an image:
<a href="link2img"><img border="0" src="path2img" /></a>