Free computer Tutorials

HOME Stay at Home and Learn

Web Design Tutorials

 
Computer Tutorials List

 

 

 

 

Using Images in HTML Tables

 

Images can be used in tables, either as the background image of the table, or in individual cells.

The web page in the link below shows an example of a table with a patterned background. Click the link to see what is meant.

Table with a Background Image

Let's see how to create it. It's quite easy.

  • Start a new web page in your HTML Editor
  • Set the background colour or image to anything you like
  • Click OK
  • With the basic HTML code displayed, click in between the two BODY tags
  • From the menu bar, click on ADD > Add a Table
  • The Add a Table dialogue box appears
  • Set the Number of Rows to one, and the number of columns to one
  • Click the "Set Up Table" button
  • You can either just click OK at this stage, or add some Extra Table Tags, a Border and a Caption, perhaps
  • Your HTML Editor will now look like this:

Setting up the Table

You can delete the CellPadding and CellSpacing tags, if you want. Delete the Border tag as well, and you'd have this:

<TABLE>

Type a space after the "E" of table, and type BACKGROUND =

<TABLE BACKGROUND = >

  • From the menu bar, click on Insert > Image
  • The Insert Image dialogue box appears
  • Click on Insert a Background Image
  • The Open Image dialogue box appears
  • Locate the image you want to use as a background
  • Click Open, then click OK when you're returned to the Insert a Background Image dialogue box.
  • Your code will look like this:

<TABLE BACKGROUND = "background12.jpg">

  • Highlight the entire table
  • Click Format > Centre
  • Save your work and load it into a browser to see the final results

 

Images in Cells

You can have an image in a Table TD cell, rather than text. To insert an image into a cell with your HTML Editor, do this:

  • Click in between a Pair of <TD> tags
  • From the menu bar, click on Insert > Image
  • From the Insert an Image dialogue box, click on Search for an Image
  • Locate the image you want to use and click OK
  • Align the image with the ALIGN and/or VALIGN attributes
  • Save your work and view the results

You can turn the image into a Link, if you want. Or just add a link instead of an image or text.

 

In the final part of HTML tables section, we'll explore nested tables.

 

<-- Back One Page Move on to the Next Part -->

<--Back to the Web Design Contents Page

View all our Home Study Computer Courses