In: Computer Science
What do the following HTML statements do? <body>
<head>
<table>
<tr>
<td>
HTML : Hyper Text Markup Language
Structure of HTMl page :
<!DOCTYPE html> <!-- specify the use of html 5 -->
<html> <!--beginning of html tag -->
<head> <!--head tag includes root of document -->
<title>Page Title</title> <!-- title is included in head tag -->
</head>
<body>
.
.
. <!-- main content of the page is written in body tag -->
.
.
</body>
</html> <!--closing of html tag -->
HTML tags and attributes:
Html Table :
<!DOCTYPE html>
<html>
<head>
<!-- style tag is used to style the document inside head tag-->
<style>
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
</style>
</head>
<body>
<h3>Basic HTML Table</h3>
<table style="width:100%">
<tr>
<th>FirstName</th>
<th>Lastname</th> <!-- <th> tag contains table headers-->
<th>Age</th>
</tr>
<tr>
<td>Steve</td> <!-- <td> tag inside <tr> tag. <td> -->
<td>Smith</td>
<td>30</td>
</tr>
<tr>
<td>John</td>
<td>Cena</td>
<td>39</td>
</tr>
<tr>
<td>Jim</td>
<td>Carry</td>
<td>50</td>
</tr>
</table> <!-- closing of table tag -->
</body>
</html>
Output of the above Table code: