You are here:   HomeHTML LanguageHTML TutorialHTML MARQUEE
by Dinesh Thakur Category: HTML

An image can either be included in a table cell or can act as a background in a table:

 

1. To add a background image: Use "background" attribute in the opening <TABLE>tag. It will take the URL of the image as its value and the background images are titled throughout the available table space.

Let’s include "shed in field. if " image file as a table background image in Code as:

<HTML>

<HEAD>

<TITLE> TABLE TAGS</TITLE>

</HEAD>

<BODY>

<TABLE BORDER=5 BACKGROUND=”d:\shed in field.gif” WIDTH = “100” HEIGHT = “200” ALIGN=”CENTER”>

<TR BGCOLOR=”PINK”>

<TH>TITLE OF BOOKS</TH>

<TH>AUTHORS</TH>

<TH>COST</TH>

</TR>

<TR>

<TD>DHTML</TD>

<TD>THOMAS A. POWELL</TD>

<TD>RS.200</TD>

</TR>

<TR>

<TD>SAD</TD>

<TD>BGCOLOR=”BLUE “>AWAD</TD>

<TD>RS.150</TD>

</TR>

<TR>

<TD>ANSI C</TD>

<TD>BALAGURUSWAMY</TD>

<TD>RS.250</TD>

</TR>

</TABLE>

</BODY>

</HTML>

 

2. To include images within Cells: Images can be included within header or data cells. For that add <IMG> attribute between the <TD> or <TH> cell tags with proper URL specifying the source of the image. The following code shows the insertion of an image in a specific cell.

 

<HTML>

<HEAD>

<TITLE> TABLE TAGS</TITLE>

</HEAD>

<BODY>

<TABLE BORDER=5 BORDERCOLOR=”PINK” WIDTH = “100” HEIGHT = “200” ALIGN=”CENTER”>

<TR BGCOLOR=”PINK”>

<TH>TITLE OF BOOKS</TH>

<TH>AUTHORS</TH>

<TH>COST</TH>

</TR>

<TR>

<TD>DHTML</TD>

<TD>THOMAS A. POWELL</TD>

<TD>RS.200</TD>

</TR>

<TR>

<TD>SAD</TD>

<TD><IMG SRC=”C:\WINDOWS\HLPGLOBE.GIF” HEIGHT=68 WIDTH=55>AWAD</TD>

<TD>RS.150</TD>

</TR>

<TR>

<TD>ANSI C</TD>

<TD>BALAGURUSWAMY</TD>

<TD>RS.250</TD>

</TR>

</TABLE>

</BODY>

</HTML>



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Search Content







Advance Courses



Basic Courses



Advertise with Us