clear: both; CSS attributes on .dataTable_wrapper and .ui-helper-clearfix:after
clear: both; CSS attributes on .dataTable_wrapper and .ui-helper-clearfix:after
I've got a table that I'm using within a jQuery-ui styled site. It's a two-column layout model with a fixed-width floated column on the right hand side. The issue I'm having is that the clear: both; CSS attribute on the .dataTable_wrapper class and the .ui-helper-clearfix:after class (part of the jQuery ui stylesheet) are causing the table in the main content column to start below where the right hand column finishes. This is obvious, because the table is told to clear all floated elements, and the right hand column is floated.
Are there any obvious solutions to this? I currently have pages with a title followed by a huge gap until the datatable. I've got a slightly hacked together solution that involves putting the filter box on the left, and then setting clear: left on the wrapper as well as clear: left in .ui-helper-clearfix:after. I can't help think that this will break other bits of the site that rely on that jquery helper class.
Table options are:
[code]
jQuery('#memberslist').dataTable({
"bJQueryUI": true,
"bPaginate": false,
"bLengthChange": false,
"bInfo": true,
"bProcessing": false,
"aoColumns": [
{ "bSortable": true },
{ "sType": "html" },
{ "bSortable": true },
{ "bSortable": false },
{ "bSortable": true, "sType":"num-html" },
{ "bSortable": true, "sType":"num-html" },
{ "bSortable": true, "sType":"numeric" }
]
}
[/code]
Are there any obvious solutions to this? I currently have pages with a title followed by a huge gap until the datatable. I've got a slightly hacked together solution that involves putting the filter box on the left, and then setting clear: left on the wrapper as well as clear: left in .ui-helper-clearfix:after. I can't help think that this will break other bits of the site that rely on that jquery helper class.
Table options are:
[code]
jQuery('#memberslist').dataTable({
"bJQueryUI": true,
"bPaginate": false,
"bLengthChange": false,
"bInfo": true,
"bProcessing": false,
"aoColumns": [
{ "bSortable": true },
{ "sType": "html" },
{ "bSortable": true },
{ "bSortable": false },
{ "bSortable": true, "sType":"num-html" },
{ "bSortable": true, "sType":"num-html" },
{ "bSortable": true, "sType":"numeric" }
]
}
[/code]
This discussion has been closed.
Replies
I think the solution is to find out what class / property is causing the issue, and then simply to remove it. If you use Firebug (or whatever) to disable the clear on dataTable_wrapper for example, does that fix the problem? Also you can specify your own classes etc for what will be used by DataTables using http://datatables.net/usage/options#sDom .
Regards,
Allan
I think the issue is that the div which is created by datatables for the header has the class 'ui-helper-clearfix'. The CSS in the jquery-ui stylesheet states that any element after this class must clear both, hence the data rows starting after the float, regardless of what the wrapper sets.
[code]
'<"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"'+
lfr>t<"'+
'"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"'+
'ip>';
[/code]
(the H and F are expanded to the jQuery UI classes basically). So what you could do is just alter the above code to remove the clearfix that you don't want.
Regards,
Allan
Screenshot: http://img22.yfrog.com/i/tableerror.png/
Allan