I have an HTML table showing a list of people. For each line, I would like to have a different progressbar-like background. Sort of
<table> <tr class="progress-full">...</tr> <tr class="progress-half">...</tr> <tr class="progress-quarter">...</tr> </table>
With all the background of the first line in color, half secord and 1/4 of the last (with classes or using directly percent in CSS).
I tried using a background with a width ( like here ), but I failed. Is it possible to enclose a div inside tr? When I check the html code (for example: with chrome), the div seems to be outside 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?
source share