Table contens in the wrong place - floating DIV's

Table contens in the wrong place - floating DIV's

GarySGaryS Posts: 1Questions: 1Answers: 0

Hi folks,

I'm just dipping my toe into DataTables and I'm having a bit of fun with it. My first project is a page that has two header tables and one main data table. However, I'm struggling with the page layout for the header.

I have set up a test case at

which shows the problem. The cyan box is the section, the red box is the DIV for the first table, and the yellow box is the DIV for the second table.

However, for some reason, the headTable appears vertically below the box it should be in. If I do not initialise the DataTable and manually code a table it appears in the yellow box as it should do.

Does anyone know why, or what I need to do to fix it?

This question has an accepted answers - jump to answer


  • allanallan Posts: 51,045Questions: 1Answers: 7,665 Site admin
    Answer ✓


    Its because of the mix of floats in your layout and also our CSS. We use clear: both on both the table and the container div:

    It might mess up other parts of your layout, but that's the issue.


Sign In or Register to comment.