dataTables_wrapper does not adjust to the number of rows in the table being passed.
dataTables_wrapper does not adjust to the number of rows in the table being passed.
Hello,
I have a php script (loadzipfiles.php) that basically just gets that contents of a directory and puts it into a table. I pass this table to dataTables and have it displayed on my webpage. I also have a div tag with an input button inside it located under the div tag where I have dataTables display my table.
Here is what it looks like on my index.php page
test button
This is what my javascript looks like:
$.get("loadzipfiles.php", function(table){
$("#displaylogs").html(table);
$("#table1").dataTable( {
"sPaginationType": "full_numbers",
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [ "copy", "xls"],
"sSwfPath": "/javascript/media/swf/copy_cvs_xls_pdf.swf"
}
});
});
The data does get displayed with 10 rows being the default number of rows to display. So now I have my files in the table displayed as well as my input button displayed right underneath it.
The problem is when I use the search box to search for something and only 3 records come back then the input button is not directly under the table. It is a few spaces below the table. When I use the Inspector element in Firefox I see a dotted line around my table. The dotted line is encompassing the blank rows as well. This dotted line is referencing "div#table1_wrapper.dataTables_wrapper".
I'm thinking because the default setting is to display 10 rows at a time that is why my input button seem so far from the table when I use the search box and only 3 records come back. Is there any setting that can be configured to make the table adjust its size according to how many records are currently being displayed?
Thank you.
Mohsin
I have a php script (loadzipfiles.php) that basically just gets that contents of a directory and puts it into a table. I pass this table to dataTables and have it displayed on my webpage. I also have a div tag with an input button inside it located under the div tag where I have dataTables display my table.
Here is what it looks like on my index.php page
test button
This is what my javascript looks like:
$.get("loadzipfiles.php", function(table){
$("#displaylogs").html(table);
$("#table1").dataTable( {
"sPaginationType": "full_numbers",
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [ "copy", "xls"],
"sSwfPath": "/javascript/media/swf/copy_cvs_xls_pdf.swf"
}
});
});
The data does get displayed with 10 rows being the default number of rows to display. So now I have my files in the table displayed as well as my input button displayed right underneath it.
The problem is when I use the search box to search for something and only 3 records come back then the input button is not directly under the table. It is a few spaces below the table. When I use the Inspector element in Firefox I see a dotted line around my table. The dotted line is encompassing the blank rows as well. This dotted line is referencing "div#table1_wrapper.dataTables_wrapper".
I'm thinking because the default setting is to display 10 rows at a time that is why my input button seem so far from the table when I use the search box and only 3 records come back. Is there any setting that can be configured to make the table adjust its size according to how many records are currently being displayed?
Thank you.
Mohsin
This discussion has been closed.