rmckeown
Member
Posted 1 year ago #
Hi - I have a table whereby the number of columns is going to increase as each week comes along - I could not see any options to have a scroll or something for when the columns become too many - I presume the column widths will just get 'squeezed' when there are more and more.
The link to my table is:
Last Man Standing
Thanks
http://wordpress.org/extend/plugins/wp-table-reloaded/
Hi,
yes, that's likely going to happen.
Now, DataTables does include a feature for scrolling, but I haven't tested it a lot. It might be as easy as adding
"sScrollX": "100%", "bScrollCollapse": true
to the "Custom Commands" textfield in the "DataTables JavaScript features" section on the "Edit" screen of your table.
Regards,
Tobias
rmckeown
Member
Posted 1 year ago #
Thanks Tobias, unfortunately this did not work. Do you think I should try and get support from DataTables people now?
rmckeown
Member
Posted 1 year ago #
Hi Tobias - from the DataTables support site - they suggest:
$(document).ready(function() {
$('#example').dataTable( {
"sScrollX": "100%",
"sScrollXInner": "110%",
"bScrollCollapse": true
} );
} );
Could you point me in the direction of where to put this code? Thanks
Hi,
where did you add the code I gave you? I can't see it in the page source...
Can you add it again, so that I can maybe find out why it is not working?
Regards,
Tobias
rmckeown
Member
Posted 1 year ago #
Thanks Tobias - that is it inserted again.
RMK
Hi,
ok, thanks for that. I don't really see why it's not working, unfortunately :-(
It might indeed be the best to now ask in the DataTables forums...
Regards,
Tobias
rmckeown
Member
Posted 1 year ago #
Ho Tobias - I finally got the DataTables to work - was a quite simple solution really. In the Custom Commands I added this: "sScrollXInner": "110%",
Therefore, the Custom Commands now reads:
"sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true
Thanks for your help on this.
rmckeown
Member
Posted 1 year ago #
Hi again Tobias - I have another quick question - on the DataTable site they say it is possible to have 'Fixed Columns', in other words freeze the left most column by using a FixedColumn script - instructions to do this are here (http://datatables.net/release-datatables/extras/FixedColumns/), in essence being able to call new FixedColumns( oTable );.
Is there any way this can be done from with WP-Tables Reloaded - I don't want to start messing about inside the plugin directory if I dont have to!
Thanks again.
Hi,
great to hear that this works now !: -)
Regarding the FixedColumns: Yes, this can be done with WP-Table Reloaded, but it is not that easy. Basically, what you will need to do: Deactivate the usage of the DataTables JavaScript library for the table in question within WP-Table Reloaded. Then, manually load/include the DataTables JS library into the page, and call it. This will finally allow you to also load the FixedColumns script manually.
Regards,
Tobias