HTML Table #Part 9

HTML Table #Part 9

           HTML tables allow web developers to arrange data into rows and columns.



Table Tag

       Table Tag is tag that contains all all table tags.

<Table></Table>

Table Heading

        Table Heading Tag is used for table Heading.

<th></th>

Table Rows

       This Tag is used for table Rows.

<tr></tr>

Table Data

    This is used to table Data.

<td></td>


Simple Table Example

<table>

<th>no</th>

<th>name</th>

<th>city</th>

<tr>

<td>1</td>

<td>bharat</td>

<td>mandvi</td>

</tr>

<tr>

<td>2</td>

<td>kanaiya</td>

<td>mandvi</td>

</tr>

</table>


Table Tag Attributes:

Table Border

Ex. <table border="4">

Cell Spacing : the amount of space between the border of a table cell and its contents.

Ex. <table cellspacing="2">

Cell Padding : The cell padding attribute places spacing around data within each cell.

Ex. <table cellpadding="2"> 

Table Border color

Ex. <table bordercolor="red">

Table background Color

Ex. <table bgcolor="red">


Table with border, color


<table border="2" bgcolor="#ffc8cb"> <th>no</th> 

 <th>name</th>

 <th>city</th>

 <tr>

 <td>1</td>

 <td>bharat</td> 

 <td>mandvi</td>

 </tr>

 <tr>

 <td>2</td> 

 <td>kanaiya</td> 

 <td>mandvi</td> 

 </tr> 

 </table>



Try it Yourself...

what you think about this article ??

Post a Comment

Previous Post Next Post