Table With Border & Without border



  • Tables are defined with <table> Tag
  • Tables are divided into two parts Rows and Columns
  • For row use <tr> tag and For Column <td>
  • <th> tag is used for Heading of the Table 
1)      Simple Table Example 
<html>
<body> 
<h1>One Column Example I use Heading tag 1</h1>
<table border = "1">
<tr>
<td>6</td>
</tr> 
</table>
<h2>This is a example of One Row two Cloumn with border </h2>
<table border="1">
<tr>
<td>1</td>
<td>5</td>
</tr>
</table>
</body>
</html>
OUTPUT:-

One Column Example I use Heading tag 1

6


This is a example of One Row two Cloumn with border

1 5
  
2) Table Without Border example
<html>
<body>
<table>
<tr>
<td> Name </td>
<td> Roll no </td>
</tr></table>
<tr>
<td> Sahil </td>
<td> 1</td>
</tr>
</table> 
</body>
</html> 

OUTPUT :-
Name Roll no
Sahil 1
3)  Table Heading  Example
<html>
<body>
Table Heading example
<table border = "3">
<tr>
<th width = "250"> Name </th>
<th width = "250"> Roll No</th>
</tr>
<tr>
<td> Sahil</td>
<td> 1</td>
</tr>
</table>
</body>
</html>
OUTPUT:-
Table Heading example
Name Roll No
Sahil 1
Note:-  In example 3 i use <th> tag. The main Benefit of <th> tag is your Table title is in bold and in Center position. You do not need to used center tag.
                                                                        Next page

 



   


 

  




 

No comments:

Post a Comment