How to make a table using HTML /CSS (beginner level)
By using the following code you can make a very simple and attractive table in your web page . For this you must have a threshold level of understanding of HTML/CSS only
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>my first code </title>
</head>
<style>
.container{
border: 2px solid black;
background-color: rgb(226, 194, 194);
}
th{
padding: 10px;
border: 2px solid black;
}
td{
padding: 20px;
border: 2px dotted black;
}
</style>
<body>
<table class="container">
<th>TABLE</th>
<tr>
<td>NAME</td>
<td>CLASS</td>
<td>ROLL NO.</td>
</tr>
<tr>
<td> person 1</td>
<td>12</td>
<td>18</td>
</tr>
<tr>
<td>person 2</td>
<td>12</td>
<td>19</td>
</tr>
<tr>
<td>person 3</td>
<td>12</td>
<td>11</td>
</tr>
</table>
</body>
</html>
Comments
Post a Comment