Title: CSS for Column Visibility
Last modified: July 24, 2017

---

# CSS for Column Visibility

 *  Resolved [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/)
 * Hi Tobias,
 * When you have a moment, could you please direct me to the CSS to affect the BUTTONS
   in Column Visibility? I need to make the buttons (DISABLE/ENABLE) obvious by 
   perhaps adding color. Thank you.
 * Brejen

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9346969)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The relevant CSS code is in the CSS file
    /wp-content/plugins/tablepress-datatables-
   buttons/css/buttons.dataTables.css of the Extension, especially in the parts 
   that deal with the “dt-button-collection” from what I can see.
 * To modify this, I recommend playing around with the Developer Tools in your browser(
   I recommend Chrome for this). There, you will see the exact CSS selectors and
   can play around with live changes. Then, add the relevant CSS to the “Custom 
   CSS” in TablePress (instead of directly editing the CSS file).
 * Regards,
    Tobias
 *  Thread Starter [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347440)
 * Thanks.
 * Anyway I can set my default fields that are enable and disabled? Right now all
   fields are enabled. Not sure if there’s an option to limit the visible fields
   on load.
 * Thanks again for your assistance.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347483)
 * Hi,
 * I’m not exactly sure, but I think the general way of hiding a column using the
   DataTables “Custom Commands” should work here.
    Please try adding this to the“
   Custom Commands” textfield on the table’s “Edit” screen to try it
 *     ```
       "columnDefs": [ { "visible": false, "targets": [ 2, 5 } ]
       ```
   
 * This should hide columns 3 and 6 and highlight/mark that in the Visibility dropdown
   as well.
 * Regards,
    Tobias
 *  Thread Starter [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347611)
 * I already have a command in there, how do I separate this command and the other
   command? Semicolon? Pipe?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347654)
 * Hi,
 * just combine them with a comma.
 * Regards,
    Tobias
 *  Thread Starter [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347731)
 * These commands did not work for me
    `"dom": "BWlfrtip","columnDefs": [ { "visible":
   false, "targets": [ 2,3,4, 5 } ]`
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347764)
 * Hi,
 * ah, looks like I forgot a `]`. Please try again with
 *     ```
       "dom": "BWlfrtip", "columnDefs": [ { "visible": false, "targets": [ 2,3,4,5 ] } ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347868)
 * That worked! Can I please get your expertise on another issue?? One last request
   about custom commands, what’s wrong with this?? I couldn’t get it to work.
 * `"dom": "Bfrtip", "buttons": [ { "extend": "colVisGroup", "text": "Phone Contacts","
   show": [0,3,5], "hide": [1,2,4,6,7,8,9,10] }, { "extend": "colvisGroup", "text":"
   Show All", "show": ":hidden" } ]`
 * I followed this from the website:
    [https://datatables.net/extensions/buttons/examples/column_visibility/columnGroups.html](https://datatables.net/extensions/buttons/examples/column_visibility/columnGroups.html)
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347891)
 * Hi,
 * I’m not an expert with these commands, unfortunately, but I can try to take a
   look. Can you please post a link to the page with the table where this problem
   happens? Thanks!
 * Regards,
    Tobias
 *  Thread Starter [Brejen2014](https://wordpress.org/support/users/brejen2014/)
 * (@brejen2014)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9347902)
 * I think I figured it out! Should be colvisGroup and not colVisGroup. LOL
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9348095)
 * Hi,
 * ah, indeed. Nice spot! Those small typos can really cause headaches…
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/)
   here in the plugin directory. Thanks!

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

The topic ‘CSS for Column Visibility’ 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/)

 * 11 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/css-for-column-visibility/#post-9348095)
 * Status: resolved