dongtan8532 2017-03-29 15:26 采纳率: 0%
浏览 54
已采纳

如何将所有数据保持在并排固定高度的td中

I am trying to put all these three data side by side. Like the second row last column. but after the first column (within php loop) 3rd and 4th elements get to lower line. screenshot

here is what I have tried (included style in line.

<?php while ($each_row = mysqli_fetch_assoc($table_data)){ ?>
                        <tr style="border: 1px solid black; ">
                            <td style="border: 1px solid black;"><?php echo $i; ?></td>
                            <td style="border: 1px solid black;"><?php echo $each_row["roll"]; ?></td>
                            <td style="border: 1px solid black;"><?php echo $each_row["name"]; ?></td>
                            <td style="border: 1px solid black; text-align:center;"><?php echo $each_row["present"]; ?></td>
                            <td style="border: 1px solid black; width: 300px;">
                                    <a href="attendence.php?change=present&date=<?php echo $today; ?>&class=<?php echo $class; ?>&batch=<?php echo $batch; ?>&roll=<?php echo $each_row["roll"]; ?>">
                                        <button type="button" name="button">Present</button></a>
                                    <a href="attendence.php?change=absent&date=<?php echo $today; ?>&class=<?php echo $class; ?>&batch=<?php echo $batch; ?>&roll=<?php echo $each_row["roll"]; ?>">
                                        <button type="button" name="button">Absent</button></a>
                                    <form class="" style="width: 100px;" action="attendence.php?change=absent&date=<?php echo $today; ?>&class=<?php echo $class; ?>&batch=<?php echo $batch; ?>&roll=<?php echo $each_row["roll"]; ?>" method="post">
                                        <input style="width: 50px;" type="text" name="late" value="0">
                                        <input style="width: 50px;" type="submit" name="" value="Late">
                                    </form>
                            </td>
                        </tr>
      <?php } ?>
  • 写回答

2条回答 默认 最新

  • doushi1996 2017-03-29 18:00
    关注

    I have a different view for your design, it might be little difficult for you to digest but you can go for BOOTSTRAP framework and use simple grid to design the same thing using <div> or <span> tags in the tabular view (which will be responsive too) and will make you form look even better.

    For Reference : Bootstrap Grid System

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配