婷婷久久综合九色综合,欧美成色婷婷在线观看视频,偷窥视频一区,欧美日本一道道一区二区

<tt id="bu9ss"></tt>
  • <span id="bu9ss"></span>
  • <pre id="bu9ss"><tt id="bu9ss"></tt></pre>
    <label id="bu9ss"></label>

    當前位置:首頁 >  站長 >  編程技術(shù) >  正文

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

     2020-10-26 11:38  來源: 腳本之家   我來投稿 撤稿糾錯

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

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

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

    解決方法:

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

            <tbody>

            <tr>
                <td>
                    序號
                </td>
                <td>
                    癥狀
                </td>
                <td>
                    符合
                </td>
                <td>
                    不符合
                </td>
                <td>
                    不確定
                </td>
            </tr>

            <?php $i = 1; ?>

            <?php foreach ($test as $item): ?>
                <!--拿到選擇項-->
                <?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è)置寬度無效的問題的文章就介紹到這了,更多相關(guān)table設(shè)置寬度無效內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

    來源:腳本之家

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

    申請創(chuàng)業(yè)報道,分享創(chuàng)業(yè)好點子。點擊此處,共同探討創(chuàng)業(yè)新機遇!

    相關(guān)標簽
    html

    相關(guān)文章

    熱門排行

    信息推薦