简体   繁体   English

在jQuery DataTables中使用sDom删除搜索框

[英]Remove search box using sDom in jQuery DataTables

I am trying to remove the existing Search box on top-right of the Table. 我正在尝试删除表格右上方的现有“ Search框。 And realign the Show Entries section at the bottom of the Table just below Showing x of y entries 并重新排列表格底部的“ Show Entries部分,紧接在下面, 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. 并且它完全混合了页脚的对齐方式。

在此处输入图片说明

SOLUTION

Use the following value for sDom to display page length control at the bottom: 使用sDom的以下值在底部显示页面长度控制:

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

See documentation on sDom option for more details and explanation of t , i , l , p and other characters. 有关tilp和其他字符的更多详细信息和说明,请参见sDom选项的文档

In order to display informational control and page length control on the left side, add extra CSS rules shown below: 为了在左侧显示信息控制和页面长度控制,请添加如下所示的额外CSS规则:

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

DEMO 演示

See this JSFiddle for demonstration. 请参阅此JSFiddle进行演示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM