Table tag

Table tag 

<table> tag: Table tag used to create table for web page.

contents of the table.

<tr>: tr stand for table row. Which is used to create row cells.

<th>: th strand for table head. Which is used to create heading of table’s,

         it is also called first row of tables.

<td>: td stands for table data. This tag used to write data in a cells.

Attributes

Border: Specify border lines around the table.

Cell Padding: The cell padding attribute allows specific space between the cells                             content.

Cell Spacing: Cell spacing allows specific space between the cells

Column Widths : You can apply the width property to individual cells ( or ) to                                        indicate the width of columns in a table.

Colspan: To create a cell that spans multiple columns.

Rowspan: To create a cell that spans multiple rows.

Example:1

<html>

<head><title>table1</title></head>

<body>

<table border="1">

<tr>

<th >Rno

<th>Name

<th>Class

<th>City

</tr>

<tr>

<td>1

<td>Ram

<td>BCA-FY

<td>Latur

</tr>

<tr>

<td>2

<td>SitaRam

<td>BCA-FY

<td>Latur

</tr>

<tr>

<td>3

<td>RajaRam

<td>BCA-FY

<td>Latur

</tr>

<tr>

<td>4

<td>Rahim

<td>BCA-FY

<td>Latur

</tr>

 </table>

</body>

</html>

 

 

OUT-PUT

 



EXAMPLE:2

<html>

<head><title>table1</title></head>

<body>

<table border="1">

<tr>

<th >Rno

<th >Name

<th>course

<th>phone

</tr>

<tr>

<td rowspan="2">1

<td rowspan="2">Ram

<td >Java

<td rowspan="2">9456465767

</tr><tr><td >html</tr>

<td rowspan="2">2

<td rowspan="2">sitaRam

<td >Java

<td rowspan="2">9456465767

</tr><tr><td >html</tr>

<td rowspan="2">3

<td rowspan="2">Rahim

<td >Java

<td rowspan="2">9456465767

</tr><tr><td >html</tr>

</table>

</body>

</html>

OUT-PUT

 



Example:3

<html>

<head><title>table1</title></head>

<body>

<table border="1">

<tr>

<td>i

<td>am

<td rowspan="6">happy<br>sad<br>hungry

<br>thursty</td>

</tr>

<tr>

<td>he

<td rowspan="3">is

</tr>

<tr><td>she</td></tr>

<tr><td>it</td></tr>

<tr>

<td>we

<td rowspan="2">are</td></tr>

<tr><td>they</tr>

</table>

</body>

</html>

OUT-PUT


Example:4

<html>
<head><title>table1</title></head>
<body>
<table border="1">
<tr><th colspan="5" bgcolor="pink"> <font color="blue">Student Information</tr>
<tr>
<th rowspan="2">Rno
<th colspan="2">Name
<th colspan="2">Address</th></tr>
</tr>
<tr>
<th> first-name<th>Last-name<th>Address1<th>Address2</tr>
<tr>
<td>1<td >Ram <td>shastri<td>sharda sadan<td>pune</tr>
<td>2<td >Ketan <td>Ahuja<td>big city<td>Delhi</tr>
<td>3<td >Raju <td>shrivastv<td>yogi nagr<td>Mumbai</tr>
<td>4<td >salim<td>shekh<td>aligad street<td>pune</tr>
</table>
</body>
</html>

OUT-PUT\





Comments

Popular posts from this blog

The structure of HTML and some basic tags

Frame tag and Example

Introduction and objective of HTML