indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : html
This Article...
Print Version
Add Comment
View Comments
html
HTML Primer 1
HTML Primer 2
Hyperlinks
Color Guide 1
Color Guide 2
Fonts in HTML
HTML Lists
Table Tutor 1
Table Tutor 2
HTMLfx
HTML Special Characters
HTML Editors
Animation and HTML
XHTML - The Bare Facts
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

Table Attributes: <table>

border=numberSets the border size of the table
align=left/center/rightControls the horizontal placement of text
cellpadding=numberUse this to set the space between table border & the contents of the table
cellspacing=numberUse this to set the space between individual cells of a table
width=number/"%"Set the width of the table

Row & Column Attributes: <tr><td><th>

valign=top/middle/bottom/baselineVertically aligns the text
align=left/center/rightControls the horizontal placement of text
nowrapSwitch off word wrap

Table Data Attributes: <td><th>

colspan=numberTo set the number of columns the data cell should span
rowspan=numberTo set the number of rows the data cell should span

Using rowspan & colspan

Create a table thus:
<table border=1>
<tr> <td rowspan=3>Rowspan</td><td>1</td> </tr>
<tr>                                                  <td>2</td> </tr>
<tr>                                                  <td>3</td> </tr>
</table>
As you can see, the first row of the table contains two data cells while the other two columns have only one. We have put the 'rowspan' value to 3 in the first data cell of the first row as there are three rows which this <td> cell should cover. The result is:
Rowspan1
2
3
Now add to the table the following:
<table border=1>
<tr><th colspan=2>Heading</th></tr>
<tr> <td rowspan=3>Rowspan</td><td>1</td> </tr>
<tr>                                                  <td>2</td> </tr>
<tr>                                                  <td>3</td> </tr>
</table>
Basically in the table which we created there were only two columns. But there is only one table header (<th>) tag. So we span it column wise giving it a value of 2 (the number of columns which this cell has to span). Previewed in browser, it looks like:
Heading
Rowspan1
2
3

User Comments

Add Comment

[Quick Stats: Number of main threads: 1, Number of sub-threads: 0]


Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.