如何修复表格的变化高度?

时间:2017-11-20 14:32:29

标签: html css

我从数据库中获取数据。显示表的高度时会发生变化。我想解决它。这意味着它不能根据数据库内容改变高度。单元格的高度和宽度必须固定。在这种情况下,宽度是固定的。 但我不知道如何修复高度,它不能改变它的高度,但它可以改变它的宽度。

 <?php
    include("C:\wamp64\www\DashBoard\Config2.php");
    echo '<DOCTYPE html>
            <head>
              </head>
                <section>
                  <body>';
                  function id($db,$p){
                    echo'<div class="tbl-header">
                      <table style="float: left; width:50% table-layout:fixed; height:50% padding:0px;" border="1" cellpadding="7"  >
                        <thead>
                           <tr>
                              <th colspan=5 style="width:15%">Testcase id</th>
                              <th colspan=5 style="width:70%">Testcase </th>

                           </tr>   
                        </thead>
                     </div>
            <div class="tbl-content"> 
              <tbody>';
                  $sql="select prefix, tc_id, tc_description from (select prefix ,tc_id ,SUBSTRING(tc_summary,4,25) as tc_description from executions1 join project_table on project_id=pro_id where pro_id=$p) as t;";  
                  $query=mysqli_query($db,$sql);
                   while($row = mysqli_fetch_array($query)){
                     echo '<tr>
                      <td colspan=5 style="width:15%">'.$row['prefix'].'-'.$row['tc_id'].'</td>
                      <td colspan=5 style="width:70%">'.$row['tc_description'].'</td>
                      </tr>';
                   }
              echo'</tbody>
             </div>
           </table>';
          }//id method ends
     echo'</body>
      </section> 
    </html>';
     $pro="select  count(project_name)from project_table;";
     $res=mysqli_query($db,$pro);
     $row=mysqli_fetch_array($res);
     $cntp=$row['count(project_name)'];

          for($p=1;$p<=$cntp;$p++){
                //displaying project id's
                id($db,$p);}
    ?>

任何人都可以帮我解决这个问题吗?

0 个答案:

没有答案