# Change DataTable options/columns/columnDef

You can change the DataTable options, columns or columnDefs seamlessly. All you need to do is to change the `dtOptions`, `dtColumns` or `dtColumnDefs` of your DataTable.

<tabset>

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('datatablesSampleApp', ['datatables']).controller('ChangeOptionsCtrl', ChangeOptionsCtrl); function ChangeOptionsCtrl(DTOptionsBuilder, DTColumnDefBuilder) { var vm = this; vm.dtOptions = DTOptionsBuilder.newOptions(); vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0), DTColumnDefBuilder.newColumnDef(1).notVisible(), DTColumnDefBuilder.newColumnDef(2).notSortable() ]; vm.changeOptions = changeOptions; vm.changeColumnDefs = changeColumnDefs; function changeOptions() { vm.dtOptions = DTOptionsBuilder.newOptions() .withPaginationType('full_numbers') .withDisplayLength(2) .withDOM('pitrfl'); } function changeColumnDefs() { vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0).notVisible(), DTColumnDefBuilder.newColumnDef(1).notVisible(), DTColumnDefBuilder.newColumnDef(2).notSortable() ]; } }
</tabset>