I have an HTML table showing a list of person. For each row, I would like to have a different progressbar-like background. Something like
<table>
<tr class="progress-full">...</tr>
<tr class="progress-half">...</tr>
<tr class="progress-quarter">...</tr>
</table>
With the whole background of the first row in color, half of the secord and 1/4 of the last one (with classes or using directly the percentage in CSS).
I tried using a background with a width (like here) but I didn't succeed. Can I enclose a div inside a tr ? When I inspect the html code (eg: with chrome) the div seems outside of the table.
<table style="width: 300px;">
<tr style="width: 75%; background: rgb(128, 177, 133);">
<div style="width: 300px;">...</div>
</tr>
<tr style="width: 50%; background: rgb(128, 177, 133);">
<div style="width: 300px;">...</div>
</tr>
</table>
Or maybe another method ?