Override theme table attributes (CSS)


(Lance Harris) #1

I’m using the Corp theme and want to override the table CSS attributes but can’t get it to work.
Looks like the border and zebra stripes are set in the tbody of the table and I have tried to put my own CSS in RW but I think specificity is killing my code.

Any help / examples appreciated.

Cheers


(Rob Beattie) #2

Have you tried @weaver? Vitor’s always really helpful with stuff like this.

Rob


(Lance Harris) #3

Hi Rob,
To be fair I did send a support question a few days ago but like all of us I’m trying to get an answer quicker than is humanly possible :slight_smile:
So I thought someone in here might know of a CSS hack to get me going.
My preference would of course be to get help from @weaver when he has the time.

Lance


(Doug Bennett) #4

As always, it’s much easier to get help with CSS overrides if you provide an URL to a page and details of the changes you’re looking to apply. Without all that, it’s a lot more difficult for folks to help, as they have to recreate (assuming they have the same resources) what you have.


(Lance Harris) #5

Hi Doug,

I did think of adding the bits but thought it was so generic folks might be able to through some light on it without.

So it’s a very basic table with standard elements (btw, it’s built with php and the data comes out of databases);

table id='calendar’
tr
th /th
/tr

tr
td /td
/tr
/table

My CSS in RW looks like this:

table.calendar {
border-collapse: initial;
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
border: none !important;
width: 100%;
}

URL is:
http://shrc.com.au/shooting/calendar/

Basically the border: none doesn’t override the theme CSS and a border remains.
I’d also like to remove the zebra stripes from the table.

Many thanks,

Lance


(klaatu) #6

Try using CSS:

table tbody tr {
	border: none !important;
}

table tbody tr:nth-child(2n+1) {
	background-color: inherit;
}

Always, always, always best to see the page or project to be sure, to be sure.


(Lance Harris) #7

Huge thanks @klaatu… worked perfectly!
And your advice taken on board re the page.

:beers::fireworks:


(Lance Harris) #8

Just a thought… don’t you hate those…

If I then wanted to add a border programmatically, will that CSS stop me from doing so?
Let’s say I like the idea of a bottom border on one tr down the table.
Will this work?:

tr style=‘border-bottom: 1px solid #ddd


(Lance Harris) #9

Figured it out…

Changed:
table tbody tr {
border: none !important;
}

to:
table tbody tr {
border: inherit;
}


(klaatu) #10

Not at all, Sir. Goes with the territory here. You figured it out though and that is the finest of all possible outcomes :clap:


(system) #11

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.