HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Inserting images into table
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
kec



Joined: 04 May 2008
Posts: 1

PostPosted: Sun May 04, 2008 6:54 pm     Inserting images into table Reply with quote

I'm a newbie and would like to insert jpg images into my table. I've created enough rows and cells, now I'm wondering how to insert the images into the rows and have them all flush right or flush left. Thanks!
kevin.carbonaro



Joined: 08 May 2008
Posts: 7
Location: Malta

PostPosted: Thu May 08, 2008 2:40 am     Insert and align jpg images in a table cell Reply with quote

Just to give you an idea with example code, the following creates a 2 column x 2 row table. The table is set to 100% width and each cell set to 50% width (2 cells add up to the 100% width of the table.

An Image Tag is placed in each cell to display an jpg.

Each Image Tag is inside a Paragraph Tag with an attribute of align="left".

You may change this attribute to 'right' or 'center'.

Please note that the image names (i.e. pic1.jpg etc...) have to be changed to your image filenames, otherwise they will not be displayed.

In addition I recommend you also learn about absolute and relative paths, as you may encounter problems of images not displaying when others view your website, even though when you check from your computer they display without problems.

I hope this information is what you required.

Code:
<table width="100%">
  <tr>
    <td width="50%">
      <p align="left"><img src="pic1.jpg"></p>
    </td>
    <td width="50%">
      <p align="left"><img src="pic2.jpg"></p>
    </td>
  </tr>
  <tr>
  <tr>
    <td width="50%">
      <p align="left"><img src="pic3.jpg"></p>
    </td>
    <td width="50%">
      <p align="left"><img src="pic4.jpg"></p>
    </td>
  </tr>
  <tr>
</table>
Corey Bryant



Joined: 15 May 2004
Posts: 8154
Location: Castle Rock CO USA

PostPosted: Wed May 14, 2008 8:32 am     Reply with quote

Source code would help us out. You should use styles to help you align the images - this will help you maintain some consistency with the browsers as well.

_________________
Corey
Toll Free Numbers | Mile High Merchant Accounts | Expression Web Blog
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial