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
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses
   

   
   
   
   
   
   

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

HTML Tutorial - Tables

 
                                                                                                                      Page 1 of 4
 

 

Information presented in a tabular form is always more popular than when they are displayed in paragraph form. Tabular information is easy to understand, utilize and recollect. Tables contain headings, rows and columns that simplify the otherwise cumbersome information and display the data with greater clarity.

This chapter elucidates the concept of tables, their creation and customization. HTML tables enable users to arrange data into tables; in the form of text, images, and forms etc. with the help of rows and columns.

Several tags can be used to make tables in a web page. They are:

Table Tag

The <table> tag defines a table. Table headers, table rows, table cells and other tables can be displayed inside the <table> tags.

Attributes of Table Tag

Border

The border attribute establishes the size of the border surrounding the table. The default value is 0. When a border is set without a value, the default value is 1.

 

 

Example:

 

<table border=2> </table>

 

 

  Cellpadding

The cellpadding attribute sets the amount of space between the cell walls and the contents. The default value for cellpadding is 1.

 

Example:

 

<table border=2 cellpadding=4> </table>
 

Cellspacing

The cellspacing attribute sets the amount of space between the cells of a table. If the borders are visible cellspacing controls the width of internal borders.

Example:

 

<table border=3 cellspacing=3> </table>

 

Width

The width attribute sets the width of the table. It can be expressed either as an absolute value in pixels, or as a percentage of screen width.

Example:

 

<table border=2 width=70%> </table>

 

Bgcolor

The Bgcolor attribute sets the background color of the entire table.

Example:

 

<table border=1 bgcolor=yellow> </table>

 

Background

The background attribute sets the background image for the table.

Example:

 

<table border=1 background=”myimage.gif”> </table>

 

Align

The align attribute sets the position of the table in relation to the page. It takes the value- left or right.

Example:

 

<table border=2 align=left> </table>

 

Hspace and Vspace

Hspace and Vspace indicate the amount of horizontal and vertical space to be put between the able and surrounding text. They must be used in conjunction with the <align> tag.

Example:

 

<table align=left hspace=10 vspace=20> </table>

 

Bordercolor

The bordercolor attribute sets the color of all the borders of the table.

Example:

 

<table border=5 bordercolor=red> </table>

 

TR Tag

The <tr> tag designates a table row. Each <tr> tag contains one or more <td> i.e. table data or <th> i.e. table header elements.

Example:

<table border=2>

<tr> <td>cricket jokes</td> <td> tennis jokes</td> <td>golf jokes</td> </tr>
<tr> <td>classic jokes</td> <td>soft jokes</td> <td>political jokes</td> </tr>
</table>
 

 

Attributes of TR Tag

Halign

Halign sets the horizontal alignment of cells in the row. It takes up the values left, center and right.

Example:

<tr halign=left> <td>common jokes</td> </tr>
 

Valign

Valign sets the vertical alignment of the row. It can be set to top, middle, bottom or baseline.

Example:

<tr valign=top> <td>common jokes </td> </tr>
 

Bgcolor

Bgcolor sets the background color for the table row.

Example:

<tr bgcolor=”#CCCC99”> <td> common jokes </td> </tr>

 

Bordercolor

Bordercolor works similarly as with the <table> tag. The basic difference is that it only sets the colors of the inside borders.

Example:

 

<tr bordercolor=red> <td> common jokes </td> </tr>

 

             

 

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