Forums

[Plugin: WP-Table Reloaded] Table customization help (3 posts)

  1. pavelevap
    Member
    Posted 2 years ago #

    Hello, there is my customization problem:

    I would like to use prices in following format in one table cell:
    <span style="color: #ff0000;"><strong>62</strong></span> (<span style="text-decoration: line-through;">65</span>) EUR

    So there is one price (in bold and red colour), second price (line-through) and currency (EUR). But it si not good solution to add the whole HTML code into one table cell. Is there any other possibility?

    For example divide it into three collumns? Is it possible to aggregate data from 3 columns in administration into one table column for readers? I think if there is any template function to display data from three columns into 1 table column, or choose which columns (rows) will be shown? For example in one table I have my own notes and I do not want show them to my readers, so I would like to show only 4 from total 6 columns.

    In my example above, instead of whole table, I would like to show table with simple template function like table(id=3&show_header=true& exclude_columns=1,5&exclude_rows=21) aggregate_columns(1, <span style="color: #ff0000;">2</span>, EUR). Or something else. What do you think about it? It would be very helpfull not only for me...

    Thank you for your help...

  2. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    for your first question:
    Sorry, there is no alternative to putting the HTML in the table.
    But you could optimize your HTML:
    <span class="current-price">62</span> (<span class="old-price">65</span>) EUR

    Then put the formatting into your CSS:
    span.current-price {
    color: #ff0000;
    font-weight:bold;
    }
    span.old-price {
    text-decoration: line-through;
    }

    Aggregation from columns, or exclusion of columns is not possible.

    But showing only part of the rows is possible:
    You can for example show the 3rd through 8th row with [table id=X row_offset=3 row_count=6 /]

    This is also possible with a template tag, if you prefer that instead of the shortcode: wp_table_reloaded_print_table("id=1&print_name=false&row_offset=3&row_count=6");

    Please see the documentation for more information about the template tag and the available parameters.

    Hope this helps!
    Tobias

  3. TobiasBg
    Member
    Posted 2 years ago #

    Hi,

    here is an even shorter suggestion for your HTML and CSS:
    62 (<span>65</span>) EUR

    Then put the formatting into your CSS:
    .wp-table-reloaded em {
    color: #ff0000;
    font-weight:bold;
    font-style:normal;
    }
    .wp-table-reloaded span {
    text-decoration: line-through;
    }

    Regards,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Topic