Take a look at the table image here
Is there a way to insert colored circles inside the table data cells?
I attempted with CSS but struggled with positioning.
.circle{
height: 25px;
width: 25px;
background-color: #bbb;
border-radius: 50%;
display: inline-block; }
Do I have to create individual classes for each color? Having separate classes for different colors can lead to lengthy CSS code.
What is the best method to achieve this?
table {
border-collapse: collapse;
table-layout: fixed;
width: 100%;
font-size: 13px;
}
th {
font-size: 14px;
font-weight: 400;
color: #888;
border-bottom: 2px solid #000;
padding: 10px 8px;
}
td {
border-bottom: 1px solid #ccc;
color: #000;
padding: 6px 8px;
text-align: center;
}
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data</td>
<td>Black</td>
</tr>
<tr>
<td>PEWA</td>
<td>Yellow</td>
</tr>
<tr>
<td>Data</td>
<td>Blue</td>
</tr>
<tr>
<td>AFW</td>
<td>Orange</td>
</tr>
<tr>
<td>YSW</td>
<td>Red</td>
</tr>
<tr>
<td>GWG</td>
<td>Green</td>
</tr>
<tr>
<td>BFD</td>
<td>Blue</td>
</tr>
<tr>
<td>VHY</td>
<td>Violet</td>
</tr>
<tr>
<td>GWY</td>
<td>Grey</td>
</tr>
<tr>
<td>WDA</td>
<td>Yellow</td>
</tr>
</tbody>
</table>