I currently have a table setup where a td element can be styled with a single background color:
https://i.sstatic.net/DoP4f.png
This is achieved using the following code:
<td colspan="1" style="background: cyan; position:relative;" ><span class="CellComment" class="smallCell">Version 1.0</td>
However, in specific cases, I wanted to divide the td into multiple colors. I attempted this by adding several div elements inside the td, each with its own background color (each div should take up equal space within the td).
It needs to be dynamic so that the same code can handle both the one-color and multi-color scenarios. If there's only one color, the corresponding div should fill the entire td.
The code I used for this approach is:
<td colspan="1"><div style="background-color:cyan; position:absolute;"></div><span class="CellComment" class="smallCell">Version 1.0</td>
(the span represents a popup that appears when hovering over the text)
Despite my efforts, the outcome was not as expected:
https://i.sstatic.net/jyss5.png
Even when using just one div, it only occupies half of the available space within the td.