user2281858
user2281858

Reputation: 1997

Remove search box using sDom in jQuery DataTables

I am trying to remove the existing Search box on top-right of the Table. And realign the Show Entries section at the bottom of the Table just below Showing x of y entries

I have used the following code.

"sDom": '<"top">tip<"bottom"flp><"clear">'

And it has mixed up the alignment at the footer completely.

enter image description here

Upvotes: 1

Views: 4378

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58860

SOLUTION

Use the following value for sDom to display page length control at the bottom:

"sDom": '<"top">t<"bottom"ilp<"clear">>'

See documentation on sDom option for more details and explanation of t, i, l, p and other characters.

In order to display informational control and page length control on the left side, add extra CSS rules shown below:

.dataTables_info, .dataTables_length {
   float:left;
   width:auto;
   padding-right:15px;
}

DEMO

See this JSFiddle for demonstration.

Upvotes: 5

Related Questions