• Resolved babray

    (@babray)


    Hi and thanks for a great plugin! I’m not a whiz at CSS but am sing a theme that has a pre-styled table with class=”fancy_table”. I have tried a couple of different thing but how can I add this so that it is used?
    Thanks!
    Betty

    http://ww.wp.xz.cn/extend/plugins/tablepress/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Betty,

    thanks for your question.

    The easiest way to achieve that is to add “fancy_table” as an “Extra CSS class” in the corresponding text field on the “Edit” screen of the table.
    Additionally, you might want to turn off the default CSS of TablePress by adding

    add_filter( 'tablepress_use_default_css', '__return_false' );

    to the end of the “functions.php” file of your theme.

    Regards,
    Tobias

    Thread Starter babray

    (@babray)

    Hey, thanks Tobias,
    Like I said, I’m no CSS guru and have tried it several ways and looked online as well. Below is the section of code dealing with the fancy_tables. I’ve tried adding this directly, as .fancy_tables {code} and nothing seems to work. Sorry to be so dense… I did add the above code as well. What needs adding to the Extra CSS class?
    Thanks again!
    Betty

    .class {
    border: 1px solid #fff;
    }

    .fancy_table th {
    letter-spacing: 1px;
    font-weight: normal;
    vertical-align: middle;
    border-bottom: 1px solid #fff;
    background: #f3f3f3 url(images/shortcodes/th.png) 0 0 repeat-x;
    text-align: center;
    padding: 15px 20px;
    text-shadow: 1px 1px 1px #fff;
    font-size: 14px;
    }

    .fancy_table td {
    padding: 10px 20px;
    border-top: 1px solid #eee;
    text-align: center;
    }

    .fancy_table tr:hover {
    background: #f3f3f3 url(images/shortcodes/th.png) 0 0 repeat-x;
    }

    .fancy_table th:first-child,
    .fancy_table td:first-child {
    text-align: left;
    padding-left: 30px;
    }

    }

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    you won’t actually have to deal with any CSS code, as that’s already loaded by your theme.
    You’ll basically just have to tell TablePress to use that CSS code instead of its own CSS code.
    That’s a two-step process:
    1. Add that code I posted above to your theme’s “functions.php”, which will turn off the TablePress default CSS.
    2. Add the word “fancy_table” into the “Extra CSS classes” textfield on the “Edit” screen of all tables that you want this styling to apply to.

    Regards,
    Tobias

    Thread Starter babray

    (@babray)

    You are wonderful, Tobias!
    That did the trick, you made it TOO simple! 🙂
    No wonder I was having trouble…
    Thanks, Betty

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Betty,

    very nice! 🙂 Thanks for the confirmation!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter babray

    (@babray)

    I will do and you can expect a donation after the first of the month!
    B

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thank you! That’s really nice, and it’s much appreciated!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Picking up CSS table style from theme’ is closed to new replies.