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.
<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>
</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
Comments
Post a Comment