php - 用于单元格填充的 CSS

标签 php css mysql html-table

我想让所有行的大小相同,但数据的行高很大。我想修复空行的行大小。表类名称为 demo。 Demo

screenshot

<?php
   while($fet=mysql_fetch_assoc($sql1))
  {
  $id=$fet['c_id'];
  $address=$fet['address'];
   $chk=$fet["c_name"];
    $in=$in+1;
    echo "<tr>";
    echo "<td style='align:center'><a class='astext' href='client_view.php?cid=".$fet["c_id"]."'>".$fet["c_name"]."</a></td>";  
    echo "<td style='align:center'><a class='ima' href='client_details.php?cid=".$fet["c_id"]."'><img src='image/edit1.png' alt='edit' style='width:20px; height:20px' title=Edit></a></td><td style='align:center'>
    <a class='ima' href='clients.php?del=".$fet["c_id"]."'><img src='image/delete1.png' alt='delete' style='width:20px;height:20px' title=Delete></a></td>";
           echo "</tr>";
      }
   if ($in < 10) {
   $empty_rows = 10 - mysql_num_rows($sql1);

    for ($m = 0; $m < $empty_rows; $m++) {
    echo '<tr><td></td><td></td><td></td></tr>';
    }
   }
?>

最佳答案

您需要在代码中添加以下 CSS

.demo td{        
    height:20px;
}

<强> Demo

关于php - 用于单元格填充的 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28960702/

相关文章:

javascript - 使用 PHP 将 mySql 数据加载到 HTML 文本框中

Mysql min函数返回不正确的结果

PHP-MySQL : Get rows from table where date between two dates

javascript - 如何在模态主体中传递多个数据-id

php - Nginx - 将包括 .php 在内的所有请求重定向到单个 PHP 脚本?

php - symfony2 并抛出异常错误

CSS clear 不适用于媒体查询

Css 过渡 div 晃动

html - Bootstrap 导航栏不会在 iPhone 上折叠

mysql - 流集中 jdbc 生产者的问题