Hi,
thanks for your post, and sorry for the trouble.
You could either move this text to above the table, by adding this to the “Custom Commands” text field on the table’s “Edit” screen:
"dom": "ilfrtip"
(This follows the documentation from https://datatables.net/reference/option/dom .)
Another idea would be to use a separate Shortcode like
[table-info id=123 field=number_rows /]
or
[table-info id=123 field=number_rows format=raw /]
(with the correct table ID). The format=raw version will give you the full number of rows, including header and footer row.
Regards,
Tobias
Thank you for the suggestions! In my case, I have many empty rows in my excel file, placeholders for stuff I want to add later. I have filtered these out with the negative filtering option. So the codes above say that the table has 4897 rows, but on screen only 297 are shown, and 297 is the number I really want. Any way around this?
Hi,
in that case, the [table-info] Shortcode is not an option, as that can only show the full number of rows. The JS method with the "dom" Custom Command should however work.
Regards,
Tobias
Hi again! I have now added this into Custom Commands:
“columnDefs”: [ { “orderable”: false, “targets”: [ 3 ] } ], “dom”: “ilfrtip”
Now the number of entries show on top, but that info flows into the “show __ entries” text. Any way around this?:
https://www.dropbox.com/s/wed5whekedh03vv/entries.PNG?dl=0
Also, how can I alter the custom command above so that columns 3 and 6 are not sortable? These columns contain text, but I have made it white and size zero, because that text is only there for search purposes.
Any help is appreciated 🙂
Hi,
to fix the positioning, please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
#tablepress-123_info {
float: none;
}
(where 123 is the table ID).
Instead of making the columns 3 and 6 not sortable, you should simply hide them, by adding this CSS:
.tablepress-id-123 .column-3,
.tablepress-id-123 .column-6 {
display: none;
}
Regards,
Tobias
Thanks a lot, I will try this. But if I hide the columns, will the invisible text inside them be searchable?
I have added some keywords in those columns (using white text, size zero), so that people will find stuff without those keywords being visible.
For example I might have “banana” in column A, visible, but in the invisible column I would have other stuff like “Chiquita, Del Monte, Dole, Fyffes, those weird yellow things”.
Hi,
yes, the search field will still search these without problems!
Regards,
Tobias