Since I don’t much variation between tables, I try to put as much into the controller to make the html page simple. And indeed I’m using data-order, i.e.
There are two important points to consider when using data-* attributes as initialisation options:
jQuery will automatically convert from dashed strings to the camel case notation used by DataTables (e.g. use data-page-length for pageLength).
If using a string inside the attribute it must be in double quotes (and therefore the attribute as a whole in single quotes). This is another requirement of jQuery’s due to the processing of JSON data.
It seems you can use all options like order or pageLength, but to be sure you can ask on the datables forum.