Write the HTML code to display the following output.
Answers
Question:-
Write a HTML code for the following output.
Code:-
This is the required code for the question.
I have attached image where you can view the output.
<!DOCTYPE html>
<html>
<head>
<style>
table
{
border-collapse: collapse;
width:700px;
text-align: center;
}
tr
{
height: 40px;
}
.yellow
{
background-color: yellow;
}
.blue
{
background-color: rgb(0, 163,255);
}
</style>
<title>
HTML Tables
</title>
</head>
<body>
<p align=center>Practice on tables in html</p>
<table border=1 align="center">
<tr class="yellow">
<td colspan=4><b>Details of students</b>
</tr>
<tr class="blue" style="font-weight: bold;">
<td>Branch
<td>Section
<td>Name
<td>Address
</tr>
<tr>
<td rowspan=4><b>Computer science</b>
<td rowspan=3><b>Section 1</b>
<td>Amit
<td>BTM Layout
</tr>
<tr>
<td>Sumit
<td>Electronic City
</tr>
<tr>
<td>Ankit
<td>Vijaynagar.
</tr>
<tr>
<td><b>Section 2</b>
<td>Anjali
<td>JP Nagar
</tr>
</table>
</body>
</html>