Experiment:TableBackgrounds
Jump to navigation
Jump to search
The purpose of this experiment is to understand the process (source editing) required to put a background on individual table cells
We will reference some docs:
https://www.mediawiki.org/wiki/Help:Tables
https://www.mediawiki.org/wiki/Topic:Vy1xwbjszqq9jpwi
| Expenditure Item | 2025 | 2024 |
|---|---|---|
| Wages | 3% | 6% |
| Retirement | 5% | 10% |
| FICA | 6% | 4% |
| Health Insurance & Other Employee Benefits | 2% | 5% |
| Retiree Health Insurance & Medicare | -14% | 9% |
This allows for row-based styling,
|-style="background-color:red"
|cell1
|cell2
|-
| heading1 | heading2 |
|---|---|
| cell1 | cell2 |
| cell3 | cell4 |
make the whole table's text a single color
| Orange | Apple | 12,333.00 |
| Bread | Pie | 500.00 |
Make the text of individual cells a different color
| Expenditure Item | 2025 | 2024 |
|---|---|---|
| Wages | 3% | 6% |
| Retirement | 5% | 10% |
| FICA | 6% | 4% |
| Health Insurance & Other Employee Benefits | 2% | 5% |
| Retiree Health Insurance & Medicare | -14% | 9% |
Make the background of individual cells a different color
We add in a style prior to the value. We can use 5 bins:
| Color | Range | source code |
|---|---|---|
| Green | >10% | | style="background-color: Green;" |
| Lime | >= 3-10% | | style="background-color: Lime;" |
| White (no added background color) | > -3 to < 3% | <none> |
| Yellow | -10% to <= -3% | | style="background-color: Yellow;" |
| Red | < -10% | | style="background-color: Red;" |
- green
- lime
- white (no color)
- yellow -3% to -10%
- red < -10%
(note originally I had the negative colors as Red, Maroon - however Maroon is too dark
| Expenditure Item | 2025 | 2024 |
|---|---|---|
| Wages | 0% | 1% |
| Retirement | 5% | 10% |
| FICA | 16% | -1% |
| Health Insurance & Other Employee Benefits | 1% | -3% |
| Retiree Health Insurance & Medicare | -14% | 9% |