jquery - Controlling width of datatable -


i have table(id="example"). applying datatable theme it.

var otable=$(#"example").datatable(); 

i want width of datatable 80% of page. solve have redefined class on view:

<style>  /*overriding  datable class cater page's need*/     .datatables_wrapper {         position: relative;         clear: both;         *zoom: 1;         width: 80%;     } </style> 

here have redefined width of datatable on view.

this works me @ point of time though.please let me know if missing predefined attribute of jquery datatable width control.

ur appreciated!

you can use:

$("#example").datatable({ "spaginationtype": "full_numbers", "bjqueryui": true, "bautowidth": false, // disable auto width calculation  "aocolumns": [   { "swidth": "30%" }, // 1st column width    { "swidth": "30%" }, // 2nd column width    { "swidth": "40%" } // 3rd column width , on  ]}); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -