Title: background color
Last modified: August 21, 2016

---

# background color

 *  Resolved [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/)
 * Hi,
    I want to change the background color, but only for cells which have content.
 * Is this possible?
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648063)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * You could try some “Custom CSS” like
 *     ```
       .tablepress-123 td:not(:empty) {
         background-color: #ff0000 !important;
       }
       ```
   
 * Note that this will not work in older browsers.
 * Regards,
    Tobias
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648204)
 * Great!
 * Thank you very much!
 * But now, there is another problem I cant solve.
    Is it possible to assign a link
   to a row? Or a cell? But in the art, that the link will remain in the line if
   I move this.
 * Is it possible to sort automatically by default the table in the art, that the
   row with the highest value in the row with the prices is the highest etc.? The
   values are in the kind of 295 / 245 / 180, 250 / 170 / 98, …….
 * But! For distances between the cells with content, i created cells without content
   between… every second row and every second column is empty.
 * I’m trying to build a new website in modern style. My actually site is [http://www.hiddenseeservice.de](http://www.hiddenseeservice.de)
   
   On the site ‘objekte’ you can see the table i’m trying to do new…..
 * Unfortunately the table i create new is in local area on my Macbook….
 * How to solve the filters above the table? Do you have an idea for that?
 * If the new project will go online with this table, of course i will donate the
   table…
 * Unfortunately my english is bad, but i hope you can understand what my problems
   are… ansonsten müsste ich es in deutsch schreiben… 😉
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648205)
 * Is it possible to sort automatically by default the table in the art, that the
   row with the highest value in the **column** with the prices is the highest etc.?
   The values are in the kind of 295 / 245 / 180, 250 / 170 / 98, …….
 * Sorry…. i meant column…
 * Regards
    Hartwig
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648206)
 * Hello Hartwig,
 * no, sorry, that’s not directly possible. It would require a new sorting algorithm
   that first extracts the highest value from the three values in a cell.
    I suggest
   that you create three columns here, one for each of the the three values.
 * Adding a link to a cell is possible with the “Insert Link” button below the table.
   That will add some HTML code for the link, and that will of course stay in the
   row even after sorting or moving it.
 * Leaving every second row and every second column empty is not a good idea. You
   can usually achieve this with CSS styling, in a much easier way.
 * For the filters, you can use the TablePress Extension from [http://tablepress.org/extensions/datatables-columnfilterwidgets/](http://tablepress.org/extensions/datatables-columnfilterwidgets/)
   
   It will however not group the elements (like “2 bis 4 Pers.”), but show them 
   individually.
 * Regards,
    Tobias
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648208)
 * Hi Tobias,
 * thank you for the fast answer.
 * Is it possible to do sorting with a hidden column?
 * _“Leaving every second row and every second column empty is not a good idea. 
   You can usually achieve this with CSS styling, in a much easier way.”_
 * Hmm…. but in that way i can make a border around the top-row (without borders
   between the cells), i would have gaps in the top and bottom borderline between
   the cells if i would have ‘normal’ distance between the cells, would i?
 * What would be the code for distances between the cells?
 * Regards,
    Hartwig
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648212)
 * Hi,
 * sorting on a hidden column? I don’t understand. If the column is not visible,
   where do you want to click to trigger the sorting?
 * I’m not exactly sure what you mean with that border around the top row. I suggest
   that you get this table up and running as far as possible and then put it on 
   a server somewhere. We can then work on styling it.
 * The distance between the cell can be changed with the `border-spacing` property.
   That’s however kind of outdated and I wouldn’t use it. (In fact, I’d not even
   use vertical borders in a table, as those make the table data harder to read.)
 * Regards,
    Tobias
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648216)
 * Hi,
 * thank you for the fast answer.
 * Okay, sorting by a hidden column was the stupid idea of a newbie 😉 …….sorry.
 * You can take a look at the border right here….
    [](http://www.hiddenseeservice.de/table/table.jpg)
 * That’s the table i created… i think the table is looking pretty nice 🙂
 * Regards
    Hartwig
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648217)
 * Hi,
 * thanks for the screenshot. Now I understand.
    For that, it might then actually
   make sense to use those empty rows and columns as dividers. As the header is 
   continuous, there’s no CSS equivalent that I can think of. So, for this, you 
   can then keep the current table structure.
 * Regards,
    Tobias
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648289)
 * Hi again,
 * okay, i deleted the empty rows and columns and created a white border around 
   the cells.
    So now i have the tiles again. But how to create a two colored border?
   It would be nice to have around the cell first a border with 1 px in darkblue
   and around the blue a white colored border with 7 px. Is this possible?
 * Regards,
    Hartwig
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648290)
 * btw. whats about cellspacing? Then i would need only one border……
 *  Thread Starter [nbv8](https://wordpress.org/support/users/nbv8/)
 * (@nbv8)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648291)
 * I tried this:
 *     ```
       .tablepress-id-1 td {
       	border-collapse: seperate !important;
       	border-spacing: 10px !important;
       }
   
       .tablepress-id-1 td {
       	border: 1px !important;
       	border-color: #000066 !important;
       	border-style: solid !important;
       }
       ```
   
 * but it didn’t works……
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648293)
 * Hi,
 * the cell spacing needs to be added to the table, not the cells:
 *     ```
       .tablepress-id-1 {
       	border-collapse: seperate !important;
       	border-spacing: 10px !important;
       }
       ```
   
 * Regards,
    Tobias

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

The topic ‘background color’ 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/)

 * 12 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/background-color-47/#post-4648293)
 * Status: resolved