Title: Table Title styling
Last modified: August 22, 2016

---

# Table Title styling

 *  Resolved [jamietgn](https://wordpress.org/support/users/jamietgn/)
 * (@jamietgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/)
 * Hey Tobias, I am trying to add styling to the title of a specific group of tables
   and can’t seem to get the css to work.
 * The way I’ve tried it is:
 * .tablepress-poll .tablepress-table-name {
    background-color: #000; text-transform:
   uppercase; padding: 5px; color: #77b143; text-align: center; margin-bottom: 0;
   text-decoration: underline; }
 * with .tablepress-poll being the “group” of tables I’d like to apply styling to.
   All other custom styling works for .tablepress-poll like thead, tbody, etc… But
   I can’t get the table-name thing to work. Any advice?
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5579981)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Can you elaborate where `tablepress-poll` is coming from? Is it an “Extra CSS
   class”?
 * Regards,
    Tobias
 *  Thread Starter [jamietgn](https://wordpress.org/support/users/jamietgn/)
 * (@jamietgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5579982)
 * The tablepress-poll is what I have in Extra-CSS class on the tables in question.
 *  Thread Starter [jamietgn](https://wordpress.org/support/users/jamietgn/)
 * (@jamietgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5579984)
 * I guess what I’m asking for is the syntax for custom css targeting the table-
   name and even the table-description as well, for specific table classes. I think
   I saw the syntax for targeting a table-id, but not a table-class.
 * I found this from another support thread that you answered:
 * .tablepress-table-name-id-123 {
 * so I tried .tablepress-table-name-tablepress-poll but that didn’t work so that’s
   why I tried splitting it up to
    .tablepress-poll .tablepress-table-name {
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5580073)
 * Hi,
 * thanks for the clarification. Unfortunately, I have bad news here 🙁 It’s not
   directly possible to target the table name or description based on an “Extra 
   CSS class”. The reason basically is that the “Extra CSS class” is added directly
   to the HTML `<table>` element, while the table name and description are created
   in `<h2>` and `<span>` tags outside of the `<table>` element.
    One idea for a
   workaround could be to place all three things in an extra wrapper with the approach
   from [https://wordpress.org/support/topic/adding-class-to-table-name-and-description?replies=4#post-5258923](https://wordpress.org/support/topic/adding-class-to-table-name-and-description?replies=4#post-5258923)
   That way, you would get an element in the page that can be targetted with that
   CSS selector.
 * Regards,
    Tobias
 *  Thread Starter [jamietgn](https://wordpress.org/support/users/jamietgn/)
 * (@jamietgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5580079)
 * Tobias, gotta hand it to you for your support first off. You’re the man.
 * As for the custom hook:
    add_filter( ‘tablepress_table_output’, ‘tp_add_div_wrapper’,
   10, 3 ); function tp_add_div_wrapper( $output, $table, $render_options ) { $output
   = “<div class=’tablepress-wrapper {$render_options[‘extra_css_classes’]}’>\n{
   $output}\n</div>”; return $output; }
 * What does the “10, 3” target? Is that hook tailored to that specific support 
   threads’ needs or is this a universal workaround and the 10,3 has nothing to 
   do with anything in particular?
 * Regardless, I will try this tomorrow and let you know if it works!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5580089)
 * Hi,
 * that `10, 3` basically tells WordPress that the function `tp_add_div_wrapper()`
   shall be run at the hook priority `10`, and that it expects `3` parameters.
    (
   The default value is `10, 1`, which can be left off and as that’s the most common
   use case, most `add_filter()` calls don’t have these arguments.)
 * Here’s more information about this: [https://developer.wordpress.org/reference/functions/add_filter/](https://developer.wordpress.org/reference/functions/add_filter/)
 * Regards,
    Tobias

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

The topic ‘Table Title styling’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/table-title-styling/#post-5580089)
 * Status: resolved