• <legend id='M5xNO'><style id='M5xNO'><dir id='M5xNO'><q id='M5xNO'></q></dir></style></legend>

  • <i id='M5xNO'><tr id='M5xNO'><dt id='M5xNO'><q id='M5xNO'><span id='M5xNO'><b id='M5xNO'><form id='M5xNO'><ins id='M5xNO'></ins><ul id='M5xNO'></ul><sub id='M5xNO'></sub></form><legend id='M5xNO'></legend><bdo id='M5xNO'><pre id='M5xNO'><center id='M5xNO'></center></pre></bdo></b><th id='M5xNO'></th></span></q></dt></tr></i><div id='M5xNO'><tfoot id='M5xNO'></tfoot><dl id='M5xNO'><fieldset id='M5xNO'></fieldset></dl></div>

      <bdo id='M5xNO'></bdo><ul id='M5xNO'></ul>

      <small id='M5xNO'></small><noframes id='M5xNO'>

      <tfoot id='M5xNO'></tfoot>
      1. 使用 PHP 打印水平而不是垂直的表格

        时间:2023-10-04

          • <legend id='V7IkV'><style id='V7IkV'><dir id='V7IkV'><q id='V7IkV'></q></dir></style></legend>

              1. <tfoot id='V7IkV'></tfoot>
                  <bdo id='V7IkV'></bdo><ul id='V7IkV'></ul>
                    <tbody id='V7IkV'></tbody>
                • <i id='V7IkV'><tr id='V7IkV'><dt id='V7IkV'><q id='V7IkV'><span id='V7IkV'><b id='V7IkV'><form id='V7IkV'><ins id='V7IkV'></ins><ul id='V7IkV'></ul><sub id='V7IkV'></sub></form><legend id='V7IkV'></legend><bdo id='V7IkV'><pre id='V7IkV'><center id='V7IkV'></center></pre></bdo></b><th id='V7IkV'></th></span></q></dt></tr></i><div id='V7IkV'><tfoot id='V7IkV'></tfoot><dl id='V7IkV'><fieldset id='V7IkV'></fieldset></dl></div>

                  <small id='V7IkV'></small><noframes id='V7IkV'>

                • 本文介绍了使用 PHP 打印水平而不是垂直的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  问题:

                  我有一个垂直打印的表格,但我希望它改为水平打印.谁能就如何实现这一目标提供指导?

                  I have a table that prints out vertical but I would like it to print horizontal instead. Anyone who can give guidance on how this can be achieved?

                  PHP 代码:

                  echo '
                      <table class="table table-condensed table-bordered neutralize">     
                          <tbody>
                              <tr>
                                  <td><b>Kriterium</td>
                                  <td><b>Betyg</td>
                              </tr>
                  ';
                  
                  while ($row = mysql_fetch_assoc($result))
                  {
                      echo '
                          <tr>
                              <td>'.$i.'</td>
                              <td>'.$row['RID'].'</td>
                          </tr>
                      ';
                  
                      $i++;
                  }
                  
                  echo '
                          </tbody>
                      </table>
                  ';
                  

                  当前输出:

                  期望的输出:

                  推荐答案

                  循环查询结果,首先构建您想要的两行,然后将它们添加到您的表中:

                  Loop through your query results first building up the two rows that you want and then add them into your table afterwards:

                  $kriterium = '';
                  $betyg = '';
                  
                  while ($row = mysql_fetch_assoc($result))
                  {
                      $kriterium .= '<td>'.$i.'</td>';
                      $betyg .= '<td>'.$row['RID'].'</td>';
                      $i++;
                  }
                  
                  echo '
                      <table class="table table-condensed table-bordered neutralize">     
                          <tbody>
                              <tr>
                                  <td><b>Kriterium</td>'.$kriterium .'
                              </tr>
                              <tr>
                                  <td><b>Betyg</td>'.$betyg .'
                              </tr>
                          </tbody>
                      </table>
                  ';
                  

                  这篇关于使用 PHP 打印水平而不是垂直的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:用 PHP 创建动态表 下一篇:PHP二维数组转HTML

                  相关文章

                  最新文章

                  <i id='DjQfy'><tr id='DjQfy'><dt id='DjQfy'><q id='DjQfy'><span id='DjQfy'><b id='DjQfy'><form id='DjQfy'><ins id='DjQfy'></ins><ul id='DjQfy'></ul><sub id='DjQfy'></sub></form><legend id='DjQfy'></legend><bdo id='DjQfy'><pre id='DjQfy'><center id='DjQfy'></center></pre></bdo></b><th id='DjQfy'></th></span></q></dt></tr></i><div id='DjQfy'><tfoot id='DjQfy'></tfoot><dl id='DjQfy'><fieldset id='DjQfy'></fieldset></dl></div>

                • <small id='DjQfy'></small><noframes id='DjQfy'>

                  <tfoot id='DjQfy'></tfoot>
                  <legend id='DjQfy'><style id='DjQfy'><dir id='DjQfy'><q id='DjQfy'></q></dir></style></legend>

                        <bdo id='DjQfy'></bdo><ul id='DjQfy'></ul>