在我的应用程序中,我必须为数据库记录显示bootsatarp网格.由于记录数量足以在没有完整页面滚动的情况下查看,因此我使用bootstrap pre-scrollable div包装我的表,它为我提供了滚动表格的功能.但是,所有时间DIV大小都是浏览器窗口的一半.我尝试了几乎每个堆栈溢出的帖子和建议,只是它们不适合我.我也试图通过支持java脚本解决这个问题,但也失败了.
这是我的HTML代码
<div class="col-md-9">
<div class="pre-scrollable">
<table class="table table-bordered table-hover header-fixed" id="sometable">
<thead>
<tr>
<th>EMP_No</th>
<th>Name</th>
<th>Designation</th>
<th>Department</th>
<th>Type</th>
<th>#Days</th>
<th>Start Date</th>
<th>End Date</th>
<th>Half day</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
<?php //php code for print the table
?>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我用PHP代码的结果在表格上填充.我不知道如何将这个DIV的高度设置为浏览器windows的固定值或全值.下面是使用的CSS
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: center;
padding: 1px;
}
thead th {
text-align: center;
background-color: #3498db;
}
tr:nth-child(even) {
background-color: #dddddd;
} …Run Code Online (Sandbox Code Playgroud) 我正在使用一些href选项卡在html表中的所有行上绘制按钮.当用户单击行按钮时,它将使用HTML GET将用户重定向到另一个包含一些行值的PHP脚本.但是在我当前的实现中,当用户单击按钮时,没有确认.我添加了基本的javascript确认框,但它非常基本,浏览器要求每次都停止弹出警报.
因此,我没有使用普通的javascript,而是找到了bootbox.js专门为CSS警报和确认框设计的库.但是,当我使用当前的jquery实现应用bootbox方法时,它不起作用!
bootbox - bootbox文档
以下是我的代码:
这是我的href代码,它使html链接
echo "<a href='approveone.php?id=$lvid&empno=$empno<ype=$leavetype&hmd=$leavehmd&dprtmnt=$empdepartment&adminname=$adminusername' class='btn btn-success btn-xs m-r-1em confirmation' >Approve</a>";
Run Code Online (Sandbox Code Playgroud)
这是我的jQuery代码部分,包含bootbox调用.
<script type="text/javascript">
$('.confirmation').on('click', function () {
return bootbox.confirm('Are you sure?');
});
</script>
Run Code Online (Sandbox Code Playgroud)