久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

      <i id='AarRk'><tr id='AarRk'><dt id='AarRk'><q id='AarRk'><span id='AarRk'><b id='AarRk'><form id='AarRk'><ins id='AarRk'></ins><ul id='AarRk'></ul><sub id='AarRk'></sub></form><legend id='AarRk'></legend><bdo id='AarRk'><pre id='AarRk'><center id='AarRk'></center></pre></bdo></b><th id='AarRk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AarRk'><tfoot id='AarRk'></tfoot><dl id='AarRk'><fieldset id='AarRk'></fieldset></dl></div>
    1. <tfoot id='AarRk'></tfoot>
        <bdo id='AarRk'></bdo><ul id='AarRk'></ul>
    2. <legend id='AarRk'><style id='AarRk'><dir id='AarRk'><q id='AarRk'></q></dir></style></legend>

      排列成每行 5 個單元格的表格

      Array into a table with 5 cells in each row(排列成每行 5 個單元格的表格)

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

    3. <tfoot id='LLQGc'></tfoot>

        <tbody id='LLQGc'></tbody>
    4. <legend id='LLQGc'><style id='LLQGc'><dir id='LLQGc'><q id='LLQGc'></q></dir></style></legend>
      <i id='LLQGc'><tr id='LLQGc'><dt id='LLQGc'><q id='LLQGc'><span id='LLQGc'><b id='LLQGc'><form id='LLQGc'><ins id='LLQGc'></ins><ul id='LLQGc'></ul><sub id='LLQGc'></sub></form><legend id='LLQGc'></legend><bdo id='LLQGc'><pre id='LLQGc'><center id='LLQGc'></center></pre></bdo></b><th id='LLQGc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LLQGc'><tfoot id='LLQGc'></tfoot><dl id='LLQGc'><fieldset id='LLQGc'></fieldset></dl></div>

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

                本文介紹了排列成每行 5 個單元格的表格的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                如何將數組中的每個項目放入每行 5 個單元格或每列 5 列且沒有行數限制的表格中.

                How can I put each item in an array into a table with 5 cells in each row or 5 columns and no limit on how many rows there are.

                這是我的代碼:

                if (mysql_num_rows($badgedata) <= 0)
                {
                  $badge = "I have no badges =(";
                }
                else
                {
                  // Sets the array for the badges
                  while($row = mysql_fetch_array($badgedata))
                  {
                    $badges[$row['badge_id']] = $row;
                  }
                  echo "<table><tbody>";
                  // Displays the badges in the array
                  foreach($badges as $badge => $id)
                  {
                    // I need the table here
                    echo "<img src="http://habbome.com/r63/c_images/album1584/$badge.gif" />";
                  }
                }
                

                推薦答案

                你只需要 echo 之前/每五個單元格之后:

                You just need to echo <tr> and </tr>'s before/after every fifth cell:

                $field = 0; // init field counter
                echo "<table><tbody>";
                // Displays the badges in the array
                foreach($badges as $badge => $id)
                {
                    if ($field % 5 == 0) echo '<tr>'; // start line before field 0 .. 5 .. 10 etc.
                    echo "<td><img src="http://habbome.com/r63/c_images/album1584/$badge.gif" /></td>"; // output as table cell
                    if ($field % 5 == 4) echo '</tr>'; // end line alter field 4 .. 9 .. 14 etc.
                    $field++; // increase field counter
                }
                if ($field % 5 != 0) echo '</tr>'; // close last line, unless total count was multiple of 5
                echo "</tbody></table>";
                

                這篇關于排列成每行 5 個單元格的表格的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                <i id='PE0kI'><tr id='PE0kI'><dt id='PE0kI'><q id='PE0kI'><span id='PE0kI'><b id='PE0kI'><form id='PE0kI'><ins id='PE0kI'></ins><ul id='PE0kI'></ul><sub id='PE0kI'></sub></form><legend id='PE0kI'></legend><bdo id='PE0kI'><pre id='PE0kI'><center id='PE0kI'></center></pre></bdo></b><th id='PE0kI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PE0kI'><tfoot id='PE0kI'></tfoot><dl id='PE0kI'><fieldset id='PE0kI'></fieldset></dl></div>
                • <tfoot id='PE0kI'></tfoot>
                    <tbody id='PE0kI'></tbody>

                      <bdo id='PE0kI'></bdo><ul id='PE0kI'></ul>
                    • <small id='PE0kI'></small><noframes id='PE0kI'>

                      <legend id='PE0kI'><style id='PE0kI'><dir id='PE0kI'><q id='PE0kI'></q></dir></style></legend>

                        1. 主站蜘蛛池模板: 久草在线在线精品观看 | 99久久99 | 91麻豆精品国产91久久久更新资源速度超快 | av网站在线播放 | 91xh98hx 在线 国产 | 精品视频一区二区三区在线观看 | 久国产精品| 国产一区二区毛片 | 九九九久久国产免费 | 久久综合久色欧美综合狠狠 | 夜夜夜操| 九九亚洲 | av电影手机版 | 永久看片| 免费一看一级毛片 | 国产成人精品综合 | 天天看天天爽 | www.色综合| 九九爱这里只有精品 | 最新中文字幕 | 一区二区三区欧美在线 | 日韩电影一区 | 久久国产精品久久久久 | 欧美成人精品 | 成人免费区一区二区三区 | 日本粉嫩一区二区三区视频 | 欧美综合久久 | 中国美女撒尿txxxxx视频 | 综合五月| 高清久久| 国产亚洲精品一区二区三区 | 成人午夜看片 | 天天搞天天搞 | 夜夜爽99久久国产综合精品女不卡 | 成人超碰 | 狠狠av| 久久久久国产一区二区三区四区 | 免费色网址| 精品久久久久久久 | 黄色网址大全在线观看 | 久久久国产一区 |