I have created html document with and without body tag and both the times I have got same results in browser. So whats the need of body tag ?
table_with_body.html
---------------------------------------------------------------
<html>
<head>Lets try this heading</head><br>Lets print this with body
tag and see its usability
<table>
<body>
<tr>
<td>name</td>
<td>password</td>
</tr>
<tr>
<td>user1</td>
<td>user1pwd</td>
</tr>
</table>
</body>
</html>
table_without_body.html
--------------------------------------------
<html>
<head>Lets try this heading</head><br>Lets print this without body tag and see its usability
<table>
<tr>
<td>name</td>
<td>password</td>
</tr>
<tr>
<td>user1</td>
<td>user1pwd</td>
</tr>
</table>
</html>
In both cases , when I see page in browser, I get same results. So why to use body tag ? In what situation does body tag make a diffrence ?


Reply With Quote
Bookmarks