我有一个带有标题的表,并且我想向标题添加输入以允许人们在表上进行过滤。例如:
<table class="table table-condensed table-hover table-striped">
<thead>
<tr>
<th>
Date Created <button id="btnToggleFilterDateCreated" class="btn btn-xs btn-primary"><i class="fa fa-filter"></i></button>
<div class="dateRangePickers">
<div class="input-group date" id="dateCreatedStartFilterDiv">
<span class="input-group-addon datepickerbutton">
<span class="glyphicon glyphicon-calendar"></span>
</span>
<input type="text" id="dateCreatedStartFilter" size="10" maxlength="10" class="form-control" readonly="readonly" /><br/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-remove"></span>
</span>
</div>
<script type="text/javascript">
$(function () {
$('#dateCreatedStartFilterDiv').datetimepicker({ });
});
</script>
</div>
</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<thead>
<tbody>
...
<tbody>
</table>
jsFiddle http://jsfiddle.net/2u425cub/
但是,一旦我将Bootstrap类应用于格式设置,我maxwidth
就会被忽略,并且输入会炸毁表中的列。有没有办法告诉Bootstrap遵守输入的10个字符的大小限制?
我不确定我是否确实了解您的问题,但我认为您应该尝试重置输入和插件的宽度,请参阅:http : //jsfiddle.net/2u425cub/1
通过使用以下CSS代码,可以做到这一点:
.input-group .form-control, .input-group-addon, .input-group-btn {
width:initial;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句