Use <colgroup>,<col> tag and use span, style Attribute
<!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">
<style>
table,th,td{
border: 2px solid black;
text-align: center;
}
table{
border-collapse: collapse;
}
table{
width: 30px; height: 30px;
}
caption{
color: rgb(23, 19, 212);
}
</style>
<title>button</title>
</head>
<body>
<!-- use <colgroup> <col></colgroup> tag -->
<table>
<colgroup>
<col span="1" style="background-color: tomato;"/>
<col span="2"style="background-color: red"/>
<col span="1" style="background-color: orange;"/>
<col span="1" style="background-color: seagreen;"/>
</colgroup>
<caption>This is my sampol table</caption>
<tr>
<th>s.No</th>
<th>class</th>
<th>Roll</th>
<th>Name</th>
<th>Phon Number</th>
</tr>
<tr>
<td>1</td>
<td>Seven</td>
<td>101</td>
<td>Naim Sardar</td>
<td>017xxxxxx</td>
</tr>
<tr>
<td>2</td>
<td>"</td>
<td>102</td>
<td>Sakib shak</td>
<td>019xxxxxx</td>
</tr>
</table>
</body>
</html>
Comments
Post a Comment