• Resolved redpas

    (@redpas)


    Hello Tobias,
    first of all great job, I love this plugin and I’ll promote it in our WP related website.
    I’m planning to use your plugin to put a table under each post (regarding a stock) with analyst ratings on it… and I would like to know how I can set the green and red colour to the cell row backgrounds in a simple way, because it would be a mess to do it using custom CSS as the number of tables will be probably few thousands and the rows probably some hundred thousands… how to do that?

    Thanks
    Stefano

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    From what I understand, most of your tables will have the same structure/layout and thus styling? If so, you can use “Extra CSS classes” to group them and then apply the same styling to all tables of that group. For more information on that, I suggest the examples at https://www.ads-software.com/support/topic/add-css-value-to-multiple-tables/ and https://www.ads-software.com/support/topic/duplicating-table-styling-via-css/

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    Hello Tobias,

    yes, all the tables will be basically the same… we just need to change the colour based on the rating change: e.g downgrade -> red, upgrade -> green, no change = white

    It would be great if there would be, near each row a field where one can set the color of that row. Because for thousand of tables it will be a long css list.
    Do you plan to add this?

    Or is there a way to make it automatically? (e.g if row3=”upgrade,PT increase” set colour = green…. else row3=”downgrade, PT decrease” colour red)

    (this is the test we are doing:
    https://i.ibb.co/WV4jdWK/example2.png )

    How to align the table headers text and make the font colour more visible?

    Thanks. PS: We will write a review on our website about your plugin and I hope you will have a premium version soon, with more features!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ok, in that case, you might actually want to look at a TablePress Extension: https://www.ads-software.com/support/topic/highlight-a-row-based-on-value/
    This should do what you need ??

    I do not have plans to add a color selection box or similar near each row. This would just make everything very messy and crowded.

    Regarding the header row: Just use the CSS approach from https://tablepress.org/faq/change-background-color-table-head-row/ but instead of the background-color CSS property use the color CSS property.

    There also won’t really be a Premium version of TablePress itself in the near future, but there are Extensions with more features available at https://tablepress.org/extensions/

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    Hi Tobias,

    great thanks.
    how to make the highlighting work with more than one parameter? E.g make it GREEN if on a cell there is one of these words: “UPGRADE, TARGET PRICE INCREASE” and RED if there is one of these words: “DOWNGRADE, TARGET PRICE DECREASE”?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    you would need a highlight parameter like:

    [table id=123 row_highlight="UPGRADE||TARGET PRICE INCREASE||DOWNGRADE||TARGET PRICE DECREASE" row_highlight_full_cell_match=false /]
    

    Then, you would get additional CSS classes that you can use:

    .tablepress-id-123 .row-highlight-upgrade td,
    .tablepress-id-123 .row-highlight-target-price-increase td {
    	background-color: #00ff00 !important;
    }.tablepress-id-123 .row-highlight-downgrade td,
    .tablepress-id-123 .row-highlight-target-price-decrease td {
    	background-color: #ff0000 !important;
    }

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    ok great. Thanks Tobias you helped me a lot.
    Last question: to apply all CSS to all tables ID what should I do?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    to apply CSS to all tables, just use

    .tablepress {
      ..
    }

    (without the -id-123 part).

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    Hello Tobias,

    Thank you very much.
    Two more questions for you:

    1) Is there a way to create multiple tables in bulk? (we need to create probably 3000 tables (each table will be used to list analyst ratings on a stock), one for each stock.) (basically 3000 duplicates of the first one (instead of clicking copy from every time)).
    2) Is there a way to have in the shortcode instead of the [table id=1 /] the name of the table? [table name=”nameofthestock”]?

    Thanks

    Stefano

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    1) Unfortunately, I can’t really think of a good way for that, except maybe using the import method. That way, you could create a ZIP archive of the same (copied) file (which is easier and faster to to 3000 times). Then, import the ZIP archive and it will create one table for each file.
    However, if all of your tables have the same structure, you might actually want to consider using just one big table, for which you use filtering, via the TablePress Extension from https://tablepress.org/extensions/row-filter/

    2) This is basically possible with a “trick”. Instead of using numbers table IDs, just use strings. You can also have table IDs like “nameofthestock” or “name-of-the-stock”. (Basically all letters, numbers, and the - (hyphen) and _ (underscore) are allowed, but no special characters or spaces.)

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    Thanks for the super fast answer. How do I make IDs strings? I guess if I put [table id=”nameofthetable”] it will not work right?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    you simply change the table ID on the table’s “Edit” screen and then use that new/changed ID in the table Shortcode on the page where you want to show it.

    Regards,
    Tobias

    Thread Starter redpas

    (@redpas)

    great thank you very much

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

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

    Thread Starter redpas

    (@redpas)

    Tobias, we have already rated it 5 stars and we will write a very positive review of your plugin and your support on our WP related website.

    I have another question for you:
    -> If we import tables, the name of the files should be ID-TableName-2019.csv?

    Thanks

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks, I really appreciate that you already rated TablePress ??

    The name of the uploaded files doesn’t really matter, it can be anything. But as the name of the file is also used in the table name, it is smart to maybe use a name like you suggest, so that you can easier recognize the tables.

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Row colour’ is closed to new replies.