write the coding for the following HTMl program class 8
Answers
Answer:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
h2{
text-align: center;
}
table {
border: 3px solid black;
}
td, th{
border: 1px solid black;
padding: 2px;
}
table.center {
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<h2>Roll Number And Marks</h2>
<table class="center">
<thead>
<th>R.No</th>
<th>Name</th>
<th>Mark</th>
<th>Grade</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Ram</td>
<td>71</td>
<td>B1</td>
</tr>
<tr>
<td>2</td>
<td>Rohit</td>
<td>50</td>
<td>C2</td>
</tr>
<tr>
<td>3</td>
<td>Suraj</td>
<td>84</td>
<td>A2</td>
</tr>
<tr>
<td>4</td>
<td>Vijay</td>
<td>60</td>
<td>B2</td>
</tr>
<tr>
<td>5</td>
<td>Amit</td>
<td>45</td>
<td>D</td>
</tr>
<tr>
<td>6</td>
<td>Raj</td>
<td>33</td>
<td>D</td>
</tr>
</tbody>
</table>
</body>
</html>