ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
FAQ
Login
 
HTML Tutorial - Index
HTML Tutorial - Introduction
HTML Tutorial - Formatting
HTML Tutorial - Links
HTML Tutorial - Images
HTML Tutorial - Forms
HTML Tutorial - Tables
HTML Tutorial - Frames
HTML Tutorial - Style Sheets
HTML Tutorial - Advance Tags
     

 
Online Personal Trainer Certification
Test Search by Job Title
Find a Personal Trainer
Job Resources
Free Self Tests and Quizzes
Find a Lawyer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Six Sigma Green Belt Certification
Lean Management Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
SEO Certification
Online Photography Course & Certification
Online Business Writing Course & Certification
Baby Sitting Course & Certification
Time Manangement Certification
Health Club Management Certification
Selling Skills Certification
Forensic Skills Certification
Green Living Course  free!
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
  All Online Courses
   

   
   
   
   
   
   

   
  Home > Courses, Tutorials & eBooks > HTML Tutorial > Tables
 
Previous Previous

HTML Tutorial - Tables

                                                                                                                           Page 4 of 4
 

Attributes of Colgroup Tag

Span

Span indicates how many columns are in the group. It works same as in <col span=….>. The default for span is 1.

Example:

 

<table border=2>
<colgroup span=2 color=red> </colgroup>
<tr> <th>Person</th> <th>Jokes</th> </tr>
<tr> <td>Mac</td> <td>Cricket Jokes</td> </tr>
</table>
 

Align

Align sets the horizontal alignment of the cells in the column group. It works like it works in the <col> tag. It takes up four values- left, right, center and justify. But justify is poorly supported by the browser.

Example:

 

<table border=2>
<colgroup span=2 align=center> </colgroup>
<tr> <th>Person</th> <th>Jokes</th> </tr>
<tr> <td>Mac</td> <td>Cricket Jokes</td> </tr>
</table>
 

Width

Width sets the width of each column in the column group. If a column group has a width of 20% and has two columns in the group, then width of each column is 20%.

Example:

 

<table border=2>
<colgroup span=2 width=20%> </colgroup>
<tr> <th>Person</th> <th>Jokes</th> </tr>
<tr> <td>Mac</td> <td>Cricket Jokes</td> </tr>
</table>
 

The tags illustrated above are applied in the following example:

Example:

 

<html>
<head>
<title> My list of jokes </title>
</head>
 
<body background ="myimage.jpg" text = “blue”>
<h1 align=center> Some More Tables </h1>
 

<table border=3 bgcolor=lime align=center cellpadding=4

bordercolor="blue">

<caption align=left><b> Good Jokes </b></caption>
<col align=right> </col>
<col bgcolor="#CCFF99"> </col>
 
<tr bgcolor="#CCCC99"><th> Joke Type </th> <th> Joke </th> </tr>
<tr><td>1.</td> <td bordercolor=red> Classic Jokes </td>
<tr><td>2.</td> <td bordercolor=red> Tennis Jokes </td>
<tr><td>3.</td> <td bordercolor=red> Cricket Jokes </td>
 
</table>
<br/> <br/>
 
<h2 align=left> Let's read a joke!</h2>

<table border=3 bgcolor=lime align=left cellpadding=4

bordercolor="blue">

<colgroup span=2 align=center bgcolor="#CCFF99"> </colgroup>
<tr> <th> Joke Type</th> <th> Joke </th> </tr>

<tr> <td>Blonde Joke </td> <td> A brunette says to a blonde, "Look! A

dead bird!" and the blonde looks up and says, "Where?"</td> </tr>

 
</table>
</body>
</html>
 
 

This is how the web page looks:

             

 
     
Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
 
© ExpertRating 2006. All Rights Reserved.