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
XHTML Tutorial - Index
XHTML Tutorial - Introduction to XHTML
XHTML Tutorial - Formatting
XHTML Tutorial - Links
XHTML Tutorial - Images
XHTML Tutorial - Forms
XHTML Tutorial - Tables
XHTML Tutorial - Frames
XHTML Tutorial - Style Sheets
XHTML Tutorial - Advanced 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 > XHTML Tutorial > Tables
Previous  Next

XHTML Tutorial - Tables

                                                                             Page 1 of 5

In this chapter you will learn

  • How to create tables in an XHTML document
  • Adding heading and text in a table
  • Adding colors to a table
  • How to format a table
  • Use of col and colgroup tag




Information presented in a tabular form is more popular than when they are displayed in paragraph form. Data arranged in a table 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. Tables are used to create lists as well as to find other elements in a page or other pages.

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

The designing and usage of tables in XHTML is more or less similar to the usage of tables in HTML. A small difference is that some attributes of some tags are not applicable in XHTML.

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 put inside a <table> tag.

The “align” and “bgcolor” attributes of the <table> tag in HTML have been are not supported in XHTML.

Attributes of Table Tag


Border establishes the size of the border surrounding the table. The default value is 0, which means there is no border at all. If border is without a value, the default is 1.

<table border=2> </table>


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


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


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


Background sets the background image for the table.

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


Bordercolor sets the color of all the borders of the table.

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

Tr Tag

The <tr> tag is the table row tag. It designates a table row in the table. Each <tr> tag contains one or more <td> or <th> elements. It works in a similar way as it does in HTML. The “bgcolor” attribute of the <tr> tag has been deprecated in XHTML.


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





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