lengthMenu not setting default value
lengthMenu not setting default value

Could you please help. The lengthMenu is not setting default value in my table. I tried idisplayLength too but same thing.
<script> $(document).ready( function () {
var otable=$('#listing').DataTable({
"orderCellsTop":true,
"idisplayLength":6,
"lengthMenu":[[6, 25, 50, -1], [6, 25, 50, "All"]],
});
I included the following cdn in my file:
<link rel="stylesheet" type="text/css" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href = "https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css">
<link rel="stylesheet" type="text/css" href = "https://cdn.datatables.net/responsive/2.2.3/css/responsive.bootstrap.min.css">
This question has an accepted answers - jump to answer
Answers
Hi @Yinka ,
It works OK for me, see here. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.
Cheers,
Colin
Thank you Colin for your timely response. I must be missing something out in the HTML. it is dynamically generated with many functions within. My task was to apply datatable to the existing table.
Regards,
Yinka
Just to add how I resolved this. I found out through the developer tool a style not define error. With the solutions that I found on stack overflow, I removed the colspan in my table head and call datatable method. I then use the jquery attr method to return the colspan and rowspan .