HTML Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
HTML Basic
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics
 

ADVANCED HTML
Introduction
Media
Meta Tag
Frame tags
Fieldset
Tooltip
DTD
Image tags
Subscript & Superscript
Bullet styles
Canvas
Other tags
Ask Your Doubts
More about HTML
Feedback
 

Table Col Span


Tutorials Html

Topic

I want a table where one of my row will have only 2 columns while others have 5 columns?
How to span the columns in html tables?



Explanation

Col Span
While using table, it will be need of time that some of our rows should have lesser columns then others. It can be easily achieved by using colspan.

For example I have a table with two rows and three colums. Now I want the first row to be of one column and the second to be of three columns.

Demo:
First Row . .
second Row 2 2
First Row
second Row 2 2
Table Spanned Table


Here we have spanned one of the column to three columns. That is instead of adding three columns we will add only one column and span it using the attribute colspan="x". In this case as the column should be spanned to three we will be adding an attribute "colspan=3".

Tag:
<table>
<tr>
<td colspan=3>
First Row</td>
</tr>
<tr>
<td>
Second Row
</td>
<td >.</td>
<td>2</td>
</tr>
</table>





Other Links

web hosting