我在表格中有更多数据,并且使用搜索过滤器对数据进行排序。我有很多专栏。在搜索过滤器中,它会搜索所有列。我想将特定列设置为具有搜索过滤器。
以下是表名和列名的代码:
def get_classifier():
score = raw_input("Enter Score:___ (between 0.0 and 1.0)")
try:
score = float(score)
except:
print('Type a Number')
return None
if not 0. <= score <= 1.:
print('Not in Score Range')
return None
if y >= 0.9:
return 'A'
elif y >= .8:
return 'B'
elif y >= .7:
return 'C'
elif y >= .6:
return 'D'
else:
return 'F'
# Continuously ask until correct number was given
a = get_classifier()
while a == None:
a = get_classifier()
print(a)
过滤搜索常见的Jquery代码:
<table class="table table-striped table-bordered dataTables-example" data-page-size="8" data-filter=#filter>
<thead>
<tr>
<th>CREATION DATE</th>
<th>TRANS DATE</th>
<th>SHEET_NAME</th>
<th>REIMBURSEMENT</th>
<th>EXPENSE TYPE</th>
<th>AMOUNT</th>
<th>DEPTID</th>
@*<th>DESCR</th>*@
<th>DESCR254</th>
<th>OUT OF POLICY</th>
</tr>
</thead>
<tbody>
@foreach (MonthlyDetailReport item in Model)
{
<tr>
@*<td>@item.SHEET_ID</td>*@
<td>@item.H_CREATION_DT</td>
<td>@item.I_TRANS_DT</td>
<td>@item.SHEET_NAME</td>
<td>@item.REIMBURSEMENT_CD </td>
<td>@item.EXPENSE_TYPE</td>
<td>@item.MONETARY_AMOUNT</td>
<td>@item.DEPTID</td>
<td>@item.DESCR254</td>
<td>@item.OUT_OF_POLICY</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="5">
<ul class="pagination pull-right"></ul>
</td>
</tr>
</tfoot>
</table>
我想要所有 $('.dataTables-example').DataTable({
dom: '<"html5buttons"B>lTfgitp',
buttons: [
{ extend: 'copy' },
{ extend: 'csv' },
{ extend: 'excel', title: 'ExampleFile' },
{ extend: 'pdf', title: 'ExampleFile' },
{
extend: 'print',
customize: function (win) {
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size', '10px');
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
的表类,我该如何添加它?如何过滤搜索每一列?