My table is structured as follows:
th1 th2 th3 th4 th5 th6
td1 td2 td3 td4 td5 td6
td1 td2 td3 td4 td5 td6
I am looking to incorporate a feature where new rows are dynamically added using a form that triggers a background process to calculate the values in each td
. This process has a duration of 10-60 seconds.
Instead of having a progress column, I want to visually represent the completion percentage by shading the entire tr
.
For instance:
th1 th2 th3 th4 th5 th6
$ 1 $ 2 $ 3 $ 4 $ 5 $ 6 [100% completed, full row shaded in light green]
$ - $ - $ - $ - $ - $ - [40% completed, 40% of row shaded in light green]
Shading only:
th1 th2 th3 th4 th5 th6
|||||||||||||||||||||||||||||||||||||| [100% completed, full row shaded in light green]
||||||||||||||| [40% completed, 40% of row shaded in light green]
||||||||| [25% completed, 25% of row shaded in light green]
|||| [10% completed, 10% of row shaded in light green]
What approach would you suggest?
Below is a sample markup for reference:
<table>
<thead>
<tr><th>th1</th><th>th2</th><th>th3</th><th>th4</th><th>th5</th><th>th6</th></tr>
</thead>
<tbody>
<tr data-progress="100"><td>$1</td><td>$2</td><td>$3</td><td>$4</td><td>$5</td><td>$6</td></tr>
<tr data-progress="40"><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr>
<tr data-progress="25"><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr>
<tr data-progress="10"><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr>
</tbody>
</table>