Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter ianfmc

    (@ianfmc)

    Some additional information: when I preview the page after editing, the CSS has been applied.

    Hi,

    I have a similar problem as mentioned above.

    I want to change the color used for marking alternating rows, but the code from FAQ does not work for me.

    I change only the color codes, but nothing happens.
    .tablepress .odd td {
    background-color: #ff0000;
    }
    .tablepress .even td {
    background-color: #00ff00;
    }
    Here is the link to the site: https://www.dicentras.lt/kainos/

    Can you help?

    Thanks,
    Sarunas

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    @ianfmc: The reason for this is that your theme is also setting the background of the table head row with some other CSS. Therefore, we’ll have to raise the priority of your “Custom CSS” by adding the !important flag. Then, to reduce the width of the table, you’ll have to use a slightly simpler selector of just .tablepress-id-1. For that command to then have an effect, please also uncheck the “Use DataTables” checkbox on the table’s “Edit” screen, as you have already turned off the individual features anyways. Then, use this new “Custom CSS”:

    .tablepress-id-1 thead th,
    .tablepress-id-1 tfoot th {
    	background-color: #002654 !important;
    	color: #FFFFFF;
    }
    
    .tablepress-id-1 {
    	width: 80%;
    }

    @sarunasm: Please make sure that the “Alternating row colors” checkbox is checked on the table’s “Edit” screen for your CSS to take an effect. (The effect that you are seeing now is being added by your theme in a slightly different way.)

    Regards,
    Tobias

    Thanks for the fast response, Tobias!

    It worked (of course) ??

    Five stars.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ??

    Best wishes,
    Tobias

    Thread Starter ianfmc

    (@ianfmc)

    Boom. Fixed.

    Thanks very much, Tobias (Vielen D?nk)

    Thread Starter ianfmc

    (@ianfmc)

    Oops…now the borders are not changing. Please see below:

    .tablepress thead th,
    .tablepress tfoot th {
    	border-color: #002654 !important;
    	background-color: #002654 !important;
    	color: #FFFFFF;
    }
    
    .tablepress thead th,
    .tablepress tfoot th,
    .tablepress td {
    	border-color: #002654 !important;
    }
    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    the color has changed just fine for me…

    Regards,
    Tobias

    Thread Starter ianfmc

    (@ianfmc)

    Hi Tobias:

    Thanks again for the quick reply!

    Do you mean the border colors are changing, or the background color? I should have mentioned that the background color DID change based on your recommendation.

    What I seeing now i the bottom and top border changing, but not the left or right. I think I added all of the cells, but could be wrong about that (I learned my CSS ‘in the streets.’)

    All the best, Ian.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    well, the border color did change, as that’s the only thing that you changed in your CSS.
    You probably want to change its line style, from dotted to solid?
    Then, you need different CSS, like

    border: 1px solid #002654 !important;

    Regards,
    Tobias

    Thread Starter ianfmc

    (@ianfmc)

    Yes: thanks, that’s better…the right- and bottom-most are still not showing up, but that is a CSS issue, I think, so I’ll look into that.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    they are showing for me in Chrome, but you could maybe make that more explicit, by adding them to the actual table (and not just the cells) as well.

    Regards,
    Tobias

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Custom CSS not applied’ is closed to new replies.