Hi,
thanks for your question, and sorry for the trouble.
I’m not exactly sure, but from what I remember about the HTML sorting of the external DataTables JavaScript library, it works by stripping all HTML tags, and then using the remaining pure text for sorting, see https://datatables.net/reference/option/columns.type. As there is not text left after doing that here, the HTML sorting might not work.
One idea could therefore be to simply do text string sorting here. For that, please try adding this to the “Custom Commands” text field on the table’s “Edit” screen:
"columnDefs": [ { "type": "string", "targets": [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] } ]
Regards,
Tobias
Thanks for the idea. The sorting didn’t seem to be affected by the custom command. Maybe an enhancement request would be to have a command that would allow the HTML to be included in the sort calculation.
Hi,
can you please turn the sorting on again, so that I can see this? I can’t think of a reason why this “Custom Command” wouldn’t work…
Regards,
Tobias
I think I might know what’s going on. There seem to be a bunch of special characters added in the blank cells (). For example, Depot Market Square’s Park or Parkland cell shows the following when looking in Chrome dev tools:
<a href="/services/recreation/rental-facilities/special-use-facilities/depot-market-square">Depot Market Square</a>
I don’t see any extra characters in the Depot Market Square cell when looking in the table editor. However, if I completely backspace out the first letter and beginning of that cell, it does appear to “delete” whatever is in there and allows it to sort correctly.
Inspecting many of the other cells, these extra characters are showing up before, after, or interspersed with the HTML. I’m unsure where those came from. Maybe because I copied the table from HTML, pasted into Excel, and then imported into TablePress. I don’t see any special characters in the Excel fields that are blank.
When I create a plain, new table and don’t add any content I’m not seeing these extra characters in Chrome developer tools. I’m assuming these were introduced from the Excel import. I tested a simple, clean Excel spreadsheet and imported it without any special characters being added as well.
So I guess somehow som special characters snuck into Excel from copying the table from HTML into Excel.
Thanks for your time on this.
Hi,
nice find! Yes, such weird invisible characters could indeed have caused this. I don’t know where they came from either, maybe something like copy/paste or Excel.
Good to hear that you found this!
Best wishes,
Tobias