Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tables and Images 1

Status
Not open for further replies.

Darkling

Technical User
Jan 10, 2003
2
US
When I put an image at the edge of a table, I get something which looks like this:


I'm really new to this, and don't know how to get around that.

Also, can I space a table so it has cellspacing only to one side? Such as a spacing of 2 pixels to the left, but none to the right, top or bottom?

Thanks in advance.
 
Make sure that you have cellspacing="0" and cellpadding="0" in your html. You can add style="margin:0;margin-left:2px;" to your table for the spacing problem. If the images still don't align, and you have already checked to make sure that the size of the cell is the same as the size of the image, post the code, and I can fix it for you.

Rick -----------------------------------------------------------
 
Thanks for the help, the table spacing part worked, but I still have an error with the images, and a new error with text not being centered (although Im using the <center> tag...)

Some of the width settings are strange (439, etc) are set like that so it lines up correctly with an image I have on the top of the page, hopefully you won't need to change those.

Here is the code for the tables(It has PHP in it, not much though...)

Some things that will help:
6cbl.jpg = bottom left corner round
6ctl.jpg = top left corner round
6cbr.jpg = bottom right corner round
6ctr.jpg = top right corner round


Code:
<table align=&quot;center&quot; bgcolor=&quot;#000000&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;600&quot;>
	<tr>
		<td>
		<img src=&quot;mptopofmen.jpg&quot;><BR><img src=&quot;menbod.jpg&quot; align=&quot;left&quot;>
		
		<table width=&quot;170&quot; height=&quot;600&quot; 
cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#cccccc&quot; 
align=&quot;left&quot;>
			<tr>
				<td valign=&quot;bottom&quot; width 
=&quot;20&quot; height=&quot;20&quot; align=&quot;left&quot;>
				<img src=&quot;6ctl.jpg&quot; 
align=&quot;left&quot; width=&quot;20&quot; height=&quot;20&quot;>
				</td>

				<td width=&quot;150&quot; height=&quot;20&quot;>
				</td>

				<td valign=&quot;bottom&quot; 
width=&quot;20&quot; height=&quot;20&quot; align=&quot;right&quot;>
				<img src=&quot;6ctr.jpg&quot; 
align=&quot;right&quot; width=&quot;20&quot; height=&quot;20&quot;>
				</td>
			</tr>
			<tr>
				<td colspan=3 valign=&quot;top&quot; 
width =&quot;150&quot; height=&quot;12&quot;>
					
					<center>
					Station Navigation
					</center>
				</td>
				
			</tr>
			<tr>
				<td colspan=4 valign=&quot;top&quot; 
width=&quot;150&quot;>
					<center>
					<?php
					include
(&quot;news/nav.txt&quot;);
					?>

					</center>
				</td>
			</tr>
			<tr>
				<td valign=&quot;bottom&quot; width 
=&quot;20&quot; height=&quot;20&quot;>
				<img src=&quot;6cbl.jpg&quot; 
align=&quot;left&quot; width=&quot;20&quot; height=&quot;20&quot;>
				</td>

				<td width=&quot;150&quot; height=&quot;20&quot;>
				</td>
				
				<td valign=&quot;bottom&quot; 
width=&quot;20&quot; height=&quot;20&quot;>
				<img src=&quot;6cbr.jpg&quot; 
align=&quot;right&quot; width=&quot;20&quot; height=&quot;20&quot;>
				</td>
			</tr>
		</table>
		<table width=&quot;439&quot; height=&quot;600&quot; 
cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bgcolor=&quot;#cccccc&quot; 
style=&quot;margin:0;margin-left:2px;&quot; align=&quot;right&quot;>
			<tr>
				<td valign=&quot;top&quot; width 
=&quot;20&quot; height=&quot;20&quot;>
				<img src=&quot;6ctl.jpg&quot; 
align=&quot;left&quot;>
				</td>
				
				<td width=&quot;439&quot;>
				</td>
		
				<td width=&quot;20&quot; height=&quot;20&quot;>
				</td>
				

			</tr>
			<tr>
				<td colspan=3 valign=&quot;top&quot;>
				<center><b>
				 :: Data Encryption Alpha ::
				</center></b>
				
				</td>
			</tr>
			<tr>
				<td colspan=3 valign=&quot;top&quot;>
					
                                        <?php
					include($id.txt);
					?>
					<?php
					if (file_exists
($id.txt)) 
					{
					}
					else
					{
					echo('<font 
size=+4><font face=arial>404 Error- File Not 
Found</font></font><br>');
					echo('<font 
size=0><font face=arial>The selected file does not exist on 
the server. Please email darkling@cybikohost.net if this is 
a broken link. Thank you, and sorry for any 
inconvinience.</font></font><br>');
					}
					?>
									
				</td>
			<tr>
				<td valign=&quot;bottom&quot; width 
=&quot;20&quot; height=&quot;20&quot;>
				<img src=&quot;6cbl.jpg&quot; 
align=&quot;left&quot;>
				</td>

				<td width=&quot;439&quot;>
				</td>

				<td width=&quot;20&quot; height=&quot;20&quot;>
				<img src=&quot;6cbr.jpg&quot; 
align=&quot;right&quot;>
				</td>			
											
			</tr>
		</td>
	</tr>
</table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top