How to place show and search boxes at corners of tables.
How to place show and search boxes at corners of tables.
I'm fairly new to DataTables and still trying to work out how to do a few things
Currently I'm looking for a way to keep the Show entries and Search bits of the table on 1 line without them over lapping and whilst keeping them at the top left and top right of the table respectively.
I have mocked up and example here http://live.datatables.net/guzodosa/7/
In it you'll see I have split the width of the page into two halves, in each I have a DataTable. But in each the table is very thin meaning that the show entries and search portions are distinct from the table. I'd like the these portions to remain above the actual table (and the similarly the showing and pagination below the table). I realise this might mean having a mininmum width for the table which is fine. But what about the case when the table is at the minimum width and that still isn't wide enough?
How do I make these portions 'anchor' at the corners of the table.
Replies
In case anyone else has this problem I got round it by using the following line the in the table initialisation script:
"dom": '<"top"<"pull-left"f> <"pull-right"ipl>>t'
That places them at the top and whether the individual elements are left or right aligned.
But I also had to set a minimum width on the table, to ensure these stayed on one line. And set the fieldset to be inline-block display so that the bits I'm talking about didn't extend beyond the corners of the table.
Bit of a hack round it, but so far it serves my purposes. But I'm sure there must be an easier way.
I've updated my example with my solution (only the first fieldset has been updated): http://live.datatables.net/guzodosa/9/edit