www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons Advanced HTML Tables Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Controlling Cell contents:

Next we are going to discuss how HTML controls the contents of cells. First of all we will see how we can align the content of our cells.

align=""
This attribute aligns the content of the cell. It can take the values; left, right or center.

bgcolor=""
This attribute sets the background color of a single cell if used with <td> and it sets the background color of the whole row if it is used with <tr>. It can take the color value as Hex or one of the color names available here.
<table cellspacing="2" cellpadding="3" border="5" width="100%"> 
   <tr>
     <th>Name</th>
     <th>Age</th>
   </tr> 
   <tr>
     <td align="left">Mr. A--Left aligned</td>
     <td align="right">10 Years--Right aligned</td>
   </tr> 
   <tr>
     <td align="center">Mr. B--Centered</td>
     <td bgcolor="pink">20 Years</td>
   </tr> 
   <tr bgcolor="#FF0000">
     <td>Mr. Z</td>
     <td>60 Years</td>
   </tr> 
</table> 
This HTML will be displayed as:
Name Age
Mr. A--Left aligned
10 Years--Right aligned
Mr. B--Centered
20 Years
Mr. Z 60 Years

Table Nesting:

Tables can also be nested by adding <table> and </table> tags within <td> and </td> tags of the enclosing <table>.

<table> 
<tr>
<td>
<table>
<tr><td>first nested table</td></tr></table>
</td>   
<td>
<table><tr><td>second nested table</td></tr></table>
</td>   
</tr> 
<table>
You can make your tables as complicated as you want. But remember to make them as complex as you can easily handle.
Next >>> Lesson No. 19: Relative and Absolute Paths





Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.