JSFiddle - React, Tailwind, and code Playground
by loginet
HTML
<table class="table" cellpadding="0" border="0" width="100%" cellspacing="0">
<thead>
<tr>
<th style="text-align:left" colspan="9"><strong> Color: </strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox" />
<label class="btn"> <span>A</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>B</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>C</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>D</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>E</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>F</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>G</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>H</span>
</label>
</td>
<td>
<input type="checkbox" />
<label class="btn"> <span>I</span>
</label>
</td>
</tr>
</tbody>
</table>
CSS
.table {
width: 100%;
}
.table caption {
font-size: 15px;
font-weight: 700;
text-align: left;
margin-bottom: 20px;
color: #333;
text-transform: uppercase;
}
.table thead {
background-color: #444;
}
.table thead tr th {
padding: 10px;
font-weight: 700;
color: #f2f2f2;
text-transform: uppercase;
}
.table thead tr th:first-child {
text-align: left;
}
.table tbody {
background-color: #fcfcfc;
}
.table tbody tr td {
padding: 10px;
text-align: left;
}
.table tbody tr td:first-child {
text-align: left;
color: #333;
font-weight: 700;
}
.table tbody tr:nth-of-type(odd) {
background: #eee;
}
@media only screen and (min-width: 320px) and (max-width: 767px) {
.table tbody {
border: 0;
}
.table tbody tr {
margin-bottom: 10px;
display: block;
border-bottom: 2px solid #ddd;
}
.table tbody td {
display: block;
text-align: right;
font-size: 13px;
border-bottom: 1px dotted #ccc;
}
.table tbody td:last-child {
border-bottom: 0;
}
.table tbody td:before {
content: attr(data-label);
float: left;
text-transform: uppercase;
font-weight: bold;
}
}