乱码乱a∨中文字幕,在线免费激情视频,亚洲欧美久久夜夜潮,国产在线网址

  1. <sub id="hjl7n"></sub>

    1. <sub id="hjl7n"></sub>

      <legend id="hjl7n"></legend>

      當(dāng)前位置:首頁(yè) >  站長(zhǎng) >  編程技術(shù) >  正文

      html解決table設(shè)置寬度無(wú)效的問(wèn)題

       2020-10-26 11:38  來(lái)源: 腳本之家   我來(lái)投稿 撤稿糾錯(cuò)

        阿里云優(yōu)惠券 先領(lǐng)券再下單

      這篇文章主要介紹了html解決table設(shè)置寬度無(wú)效的問(wèn)題,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

      如果對(duì)table設(shè)置table-layer:fixed樣式后,發(fā)現(xiàn)表格中有一行合并過(guò),其它沒(méi)有合并的行的列寬會(huì)平均化,對(duì)列寬的設(shè)置會(huì)失效。

      解決方法:

              <col style="width: 100px;"/>
              <col>
              <col style="width: 100px;"/>
              <col style="width: 100px;"/>
              <col style="width: 100px;"/>

      在tbody前面加

      .detail {
          padding-bottom: 50px;
          margin-top: 80px;
      }

      .detail_table {
          table-layout:fixed;/*列寬由表格寬度和列寬度設(shè)定。*/
          margin: auto;/*table居中*/
          text-align: center;
          border: 1px solid #804040;
          border-collapse: collapse;
      }

      .detail_table th {
          padding: 26px;;
      }

      .detail_table td {
          border: 1px solid #804040;
          padding-top: 16px;
          padding-bottom: 16px;
      }

      .special {
          text-align: left;
          padding-left: 20px;
      }

      <div class="detail">

          <table class="detail_table">

              <thead>
              <th colspan="5">選擇的選項(xiàng)明細(xì)</th>
              </thead>
              <!--寫的話就按照你寫的寬度,但是如果你寫的寬度占不滿table它會(huì)按照你給的尺寸的比例平分至每個(gè)td-->
              <!--現(xiàn)在這么寫就是四列是100px,沒(méi)給數(shù)據(jù)的那一列占剩下的全部-->
              <col style="width: 100px;"/>
              <col>
              <col style="width: 100px;"/>
              <col style="width: 100px;"/>
              <col style="width: 100px;"/>

              <tbody>

              <tr>
                  <td>
                      序號(hào)
                  </td>
                  <td>
                      癥狀
                  </td>
                  <td>
                      符合
                  </td>
                  <td>
                      不符合
                  </td>
                  <td>
                      不確定
                  </td>
              </tr>

              <?php $i = 1; ?>

              <?php foreach ($test as $item): ?>
                  <!--拿到選擇項(xiàng)-->
                  <?php $temp = $this->session->userdata('b' . $i) ?>

                  <tr>

                      <td>
                          <?php echo $i; ?>
                      </td>

                      <td>
                          <?php echo $item; ?>
                      </td>

                      <td>
                          <?php if ($temp == 1): ?>√<?php endif ?>
                      </td>
                      <td>
                          <?php if ($temp == 2): ?>√<?php endif ?>
                      </td>

                      <td>
                          <?php if ($temp == 3): ?>√<?php endif ?>
                      </td>

                  </tr>

                  <?php $i++; ?>

              <?php endforeach; ?>

              </tbody>

          </table>

      </div>

      到此這篇關(guān)于html解決table設(shè)置寬度無(wú)效的問(wèn)題的文章就介紹到這了,更多相關(guān)table設(shè)置寬度無(wú)效內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

      來(lái)源:腳本之家

      鏈接:https://www.jb51.net/web/738041.html

      申請(qǐng)創(chuàng)業(yè)報(bào)道,分享創(chuàng)業(yè)好點(diǎn)子。點(diǎn)擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

      相關(guān)標(biāo)簽
      html

      相關(guān)文章

      熱門排行

      信息推薦