Site logo

Archived topic

Question on wordpress table coloring

20 replies · Started by William on June 14, 2020

Viewing posts 1–15 of 21

I have been trying to change the background color and the table and cell border colors inside WordPress.

Is there CSS I can use to do this? I have tried, but seemingly can't get any of this to change.

https://imgur.com/a/Z9IP2t0

I'd like to make the background color darker and the the border color a more pronounced black.

Thanks in advance if anyone has any tips on this.

Hi there,

Where can I see that table?

Let me know :)

Try this:

.wp-block-table table {
    background-color: #000;
}
table, th, td {
    border: 1px solid #ffffff;
}

Hi Leo -

Thank you for the CSS code, unfortunately it doesn't seem to have done the trick. I'm guessing wordpress simply doesn't allow their tables to be edited?

Thank you.

Hi there,

it is possible to change the colors. That link your provided results in a page not found. If you want to fix that so we can see the table and add the CSS Leo provided we can take a look at the issue.

Can you add the CSS Leo provided and clear your autoptimize cache.

Hi David -

I did that, and seems to be no change. Maybe I'm applying the CSS in the wrong space. I'm adding the CSS in the back end of the WordPress editor post area. Specifically, in the "advanced" section. Here is a screenshot: https://imgur.com/a/yNWS1a8

Should I be applying this CSS differently?

Thanks again.

That field is for adding custom CSS classes.

Add Leo's CSS to Customizer > Additional CSS

Thanks David - If I am applying the CSS to just one specific post, is there a best approach to getting this implemented? Currently I'm on the published article, then going to the "Customize" button and from there clicking "Additional CSS" - will that apply it just to the article itself?

Thank you.

In that case the field you were using before ( as you showed here ).

Give it an Additional CSS class of: dark-table
Then you can style it specifically with this CSS:

.dark-table.wp-block-table table {
    background-color: #000;
}
.dark-table table, .dark-table th, .dark-table td {
    border: 1px solid #ffffff;
}

Thanks David. So put the dark-table CSS class here? https://imgur.com/a/8mSXOB8 then publish the post and once live, add this CSS using the "Customize" > "Additional CSS" on the front-end?

.dark-table.wp-block-table table {
background-color: #000;
}
.dark-table table, .dark-table th, .dark-table td {
border: 1px solid #ffffff;
}

Looks correct. Have you tried it?

Hey Leo -

Yes, I have tried it. No luck yet. I have the dark-table css class in the back end and then in the front end I have I added the CSS code above.

I could be doing something wrong: https://glitchmind.com/reddit-battlestations/

This archived topic is closed to new replies.