datatables responsive
datatables responsive
hongjae
Posts: 3Questions: 1Answers: 0
Hi I want to use the responsive attribute of datatable
but I'm not sure if I'm missing something and need help applying it
The js file and css file are applied.
ps.Currently using jquey and bootstrap
<table id="gridtest" class="table table-striped table-bordered nowrap " style="width: 100%" >
$('#gridtest').DataTable({
data : ajax.data
, responsive: true
, paging: false
, searching: false
, info: false
, scrollCollapse: false
, language: {
emptyTable: " "
}
, columns: [
{ data: 'console_ip'}
, { data: 'sub_category'}
, { data: 'hostname'}
, { data: 'base_os_type'}
]
});
What am I missing?
This question has an accepted answers - jump to answer
Answers
Did you include the Responsive code?
Kevin
Is there anything else I need to put in the datatables opts besides responsive: true?
The docs I linked to shows what you minimally need to do. You need the responsive .js and .css and to enable with
responsive: true
. Take a look at the Responsive examples. If you are having difficulties then please post a link to your page or test case replicating the issue so we can help debug.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks for the help, I'll try the link you provided for now.