【发布时间】:2019-09-23 17:06:28
【问题描述】:
我希望有一个使用行跨度的侧列,该列具有支付周期并将该支付周期中的日期分组在一起。我希望主管能够创建一个新的支付周期,该周期在数据库中生成一个整数,然后行跨度将对该支付周期内提交的所有数据进行分组。
我当前的表代码:
<div class="table-responsive">
<table id="editable_table" class="table table-bordered table-striped" data-editable="true" data-buttons-toolbar=".toolbar" data-search="true"data-show-refresh="true" >
<thead>
<tr>
<th>Index</th>
<th>Employee ID</th>
<th>Username</th>
<th>Date</th>
<th>Time In</th>
<th>Time Out</th>
<th>Total Hours</th>
<th>Submit Status</th>
<th>Approved Status</th>
<th>Time Change</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<?php
while($row = $res->fetch()){
echo '
<tr>
<td>'.$row["id"].'</td>
<td>'.$row["user_id"].'</td>
<td>'.$row["name"].'</td>
<td>'.$row["submit_day"].'</td>
<td>'.$row["time_in"].'</td>
<td>'.$row["time_out"].'</td>
<td>'.$row["total_hours"].'</td>
<td>'.$row["submit_status"].'</td>
<td style="color:green;">'.$row["approve_status"].'</td>
<td>'.$row["change_request"].'</td>
<td><center><a id="editbtn" href="action.php?id='.$row["id"].'"><span class="glyphicon glyphicon-edit"></span></a></td>
</tr>';
}
?>
</tbody>
</table>
</div>
我不确定如何使用 rowspan 来整理数据,使其看起来像这样: Example table
【问题讨论】:
-
您得到想要的答案了吗?
-
@AdamWhateverson 不一定,我想让主管单击一个按钮以在数据库中生成一个新的 int 值,该值指定支付期间,因此在此支付期间提交的任何时间都将属于行跨度与那个时期有关。不确定这是否有意义,但如果您需要更多解释,我可以尝试使其更有意义。
-
你需要改变你最初提出问题的方式,因为听起来你想知道行跨度是如何工作的,而不是整个界面。
-
@AdamWhateverson 问题已更新
-
我已经更新了我的答案,因此我认为不需要行跨度,预先计算行跨度需要是过度的。我的方案可以让你直接输出代码,不用在输出前存储代码。
标签: javascript php html sql