# With options

The `angular-datatables` provides the helper `DTOptionsBuilder` that lets you build the datatables options.

It also provides the helper `DTColumnBuilder` that lets you build the column and column defs options.

See the API for the complete list of methods of the helpers.

Note:

- When rendering a static table, you CANNOT use the `dt-column` directive. Indeed, the module will render the datatable after the promise is resolved. So for DataTables, it's like rendering a static table. If you need to provide some options to your column, your must provide the `dt-column-defs` directive (which corresponds to the DataTables columnDefs).

ID | First name | Last name
--- | --- | ---
1 | Foo | Bar
123 | Someone | Youknow
987 | Iamout | Ofinspiration

ID | First name | Last name
--- | --- | ---
1 | Foo | Bar
123 | Someone | Youknow
987 | Iamout | Ofinspiration

angular.module('showcase.withOptions', ['datatables']).controller('WithOptionsCtrl', WithOptionsCtrl); function WithOptionsCtrl(DTOptionsBuilder, DTColumnDefBuilder) { var vm = this; vm.dtOptions = DTOptionsBuilder.newOptions() .withPaginationType('full_numbers') .withDisplayLength(2) .withDOM('pitrfl'); vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0), DTColumnDefBuilder.newColumnDef(1).notVisible(), DTColumnDefBuilder.newColumnDef(2).notSortable() ]; }