• Resolved mpet29

    (@mpet29)


    I am attempting to create a table with about 100 entries (25 rows, 4 columns).

    Approximately 40 of those entries, spread among the 4 columns, need to have a particular cell background color (the rest will be transparent).

    I have created a CSS class for those 40 and have managed to get the background color to display successfully, but I can’t get the spacing right. What is happening is that it is judging the background color display (for example, if I use padding, or span) based off of the name listed in the cell. Since the names are all different lengths, the color padding isn’t consistent.

    What I need to do is find a way to make the cell color background a certain color, regardless of the copy that is actually in the cell. Any thoughts?

    http://ww.wp.xz.cn/extend/plugins/wp-table-reloaded/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mpet29

    (@mpet29)

    I should add that I realize that this code from the FAQ

    {
    .wp-table-reloaded-id-4 .row-3 .column-2 {
       background-color: #ff0000;
    }

    will work. I just don’t want to have to go into the CSS and have a ton of different arguments like that every time I change the values here, which – since this is a baseball site – could be quite often.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question.

    So, basically, what you need is a CSS class added to certain table cells, right?
    I suggest that you try to follow this thread: http://ww.wp.xz.cn/support/topic/wp-table-reloaded-easy-way-for-client-to-right-align-currency-data
    where we added one for currency values. This probably just need slight changes for your use case.

    Regards,
    Tobias

    Thread Starter mpet29

    (@mpet29)

    Thanks. Is there a way to do it without using PHP? I know enough CSS to get by but I know very little about editing PHP. I was hoping to set a style in the custom CSS box and then apply that style to each cell I need.

    Thread Starter mpet29

    (@mpet29)

    Also – it looks like in that other example, it’s changing the background color based on whether a “$” is displaying in the cell, right?

    On mine, there wouldn’t be anything visible like that which would be used as a trigger to set that, it’s just people’s names. I’d like to just be able to do something like <span class=”roster”> in front of the names that should be colored… if possible.

    Thread Starter mpet29

    (@mpet29)

    I figured it out!

    I just needed to throw a “display:block” into the style.

    Thanks – love the plug-in.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, that’s a great idea then, too!

    Thanks for sharing it!

    Regards,
    Tobias

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

The topic ‘[Plugin: WP-Table Reloaded] set specific cell color background’ is closed to new replies.