• I need a simple way for a client to cause one column in some tables to right-align so that her dollar-value data line up properly over each other in the usual accounting fashion.

    She will need to add tables on a recurring basis, and doesn’t know coding, so coding each table separately won’t work for her. Not every table will use the same layout, and the website is designed to be self-serve for her to use and update without my assistance.

    Her example is at https://www.lawfoundationbc.org/grants/

    I tried using <td align=”right”>$100.00</td> in the cells in my experimental table in my own website, https://www.kiangle.com/?p=520, but this created an extra column, as you can see. Obviously, I’d like the data to be under the “Amount” heading!

    Any ideas?

    Thanks for your help.

    ea/

Viewing 4 replies - 16 through 19 (of 19 total)
  • Hi Kevin,

    yes, that is correct. The reason is that the $ makes the value to a string which is sorted differently than numbers.

    To sort these currencies, an extra piece of JavaScript code is necessary. Please take a look at the first posts in https://www.ads-software.com/support/topic/wp-table-reloaded-sorting-currencies-not-working where this is explained.

    Regards,
    Tobias

    Tobias,

    I’ve added the plugin and applied the custom code as described in the first post and it seems to be working correctly; however, we’re using 4 columns with dollar values and the example only addresses 1 column.

    Can you clarify the custom code so that it can be applied to columns 2 thru 5?

    Thanks,

    Kevin

    After further research, I was able to find a thread with the answer to my question. The custom code looks like this:

    “aoColumnDefs”: [ { “sType”: “currency_sorting”, “aTargets”: [ “column-2”, “column-3”, “column-4”, “column-5” ] } ]

    Thanks for you help.

    Hi,

    exactly, you will just need to write the columns as a comma-separated list. Great that you found the solution ??

    Best wishes,
    Tobias

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘[WP-TABLE RELOADED] Easy way for client to right-align currency data’ is closed to new replies.