Site logo

Archived topic

Changing colour of certain segments of a table.

3 replies · Started by chris on April 15, 2021

Viewing posts 1–4 of 4

Hi im trying to display there different colours as a background, one for Blue for low season, green for mid season, and orange for high season. But can't seem to anything other than the whole background colour for the table.

Just the end three collums require colour background, if that's possible? I also tried to add different css classses to each box to see if i could colour from CSS that way but the table uses one CSS thing for all boxes in the table.

Any thoughts how i could get this done?

Thanks.

Hi Chris,

You could give this CSS a try:

.gb-container.gb-container-4e782949 .wp-block-table table > tbody > tr > td:nth-child(2) {
    background-color: blue;
}
.gb-container.gb-container-4e782949 .wp-block-table table > tbody > tr > td:nth-child(3) {
    background-color: green;
}
.gb-container.gb-container-4e782949 .wp-block-table table > tbody > tr > td:nth-child(4) {
    background-color: orange;
}

nth-child(2) the number here means the 2nd cell of the row.

Let me know :)

Absolute hero thank you so much.

You are welcome :)

This archived topic is closed to new replies.