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 2 of 4

TD Tag

The <td> tag sets a single table cell in which data is shown. Td means table data.




<td> weird jokes </td>
<td> classic jokes </td>

Attributes of <td> Tag


Align sets the horizontal alignment of text within the table cell. It takes up the values left, center, and right.



<td align=left> classic jokes </td>



Valign is the vertical alignment of text within the table cell. It takes up the values- top, middle, center, bottom, and baseline.



<td valign=top> classic jokes </td>


Colspan and Rowspan

Table cells can span across more than one column or row. The attributes colspan and rowspan indicate how many columns or rows a cell should take up. We can create a cell that is equivalent to two cells.



<tr border=2>
<td colspan=2> jokes </td>
<td> classic jokes </td> <td> cricket jokes</td>


Nowrap indicates that the text should not wrap in the cell. Nowrap does not wrap the text, no matter how long the sentence is.



<tr> <td nowrap> The text written in this sentence will not be wrapped in any case. </td> </tr>


Bgcolor sets the background color of a single cell in a table.



<tr> <td bgcolor=”#FF6699”> Good jokes </td> </tr>



Bordercolor works similarly as it works with the <table> tag. It sets the color of the entire border around a cell.



<tr border=2> <td bordercolor=red> Nature Jokes </td> </tr>



TH Tag

The <th> tag works just like the <td> tag, except that the cell is a header for a column or a row. The header serves like a title for a column or a row.



<tr> <th> Category of jokes </th> </tr>


The following example illustrates an HTML table applying the tags described above: 



<title> My list of jokes </title>
<body background ="myimage.jpg" text = “blue”>
<h1 align=center> Page Of Tables </h1>
<table border=3 bgcolor=lime align=center cellpadding=4 bordercolor="blue">
<tr bgcolor="#CCCC99"><th colspan=2> Jokes </th> </tr>
<tr bgcolor="#CCCC99"><td> Serial no.</td><td>Joke Type</td></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>



<h2 align=left> My Favourite Joke </h2>

<table border=2 bgcolor=lime align=left cellpadding=4 bordercolor="blue">
<tr> <th>Joke Type</th> <th>Joke</th> </tr>
<tr> <td>Classic Joke </td> <td nowrap bordercolor=red> The text written in this will not be wrapped in any case. No matter how long the text is. </td>

This is how the web page looks




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