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
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
Makeup Artist 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


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.





<table border=2> </table>




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




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


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.



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



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.



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



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



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



The background attribute sets the background image for the table.



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



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



<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.



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



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



<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.


<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>


Attributes of TR Tag


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


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


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


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


Bgcolor sets the background color for the table row.


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



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



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




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