表行未展开为全宽 [英] Table Row Not Expanding To Full Width

查看:69
本文介绍了表行未展开为全宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,当我将表设置为100%的宽度和表行到宽度pf 100%没有发生任何变化,这里的宽度是一个小提琴。 JsFiddle

i have a table and when i set the table to a width of 100% and the table rows to a width pf 100% nothing happens or changes to the width here is a fiddle. JsFiddle

HTML

<table id="top-leader" class="Table-Normal">
                <thead>
                    <tr>
                        <td>Position</td>
                        <td>Name</td>
                        <td>Kills</td>
                        <td>Deaths</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>John Doe</td>
                        <td>16 Kills</td>
                        <td>0 Deaths</td>
                    </tr>

                    <tr>
                        <td>2</td>
                        <td>John Smith</td>
                        <td>13 Kils</td>
                        <td>1 Death</td>
                    </tr>

                    <tr>
                        <td>3</td>
                        <td>Bob Smith</td>
                        <td>11 Kills</td>
                        <td>0 Deaths</td>
                    </tr>
                </tbody>
            </table>

CSS

/* Tables */
.Table-Normal {
    position: relative;
    display: block;
    margin: 10px auto;
    padding: 0;
    width: 100%;
    height: auto;
    border-collapse: collapse;
    text-align: center;
}

.Table-Normal thead tr {
    background-color: #E74C3C;
    font-weight: bold;
}

.Table-Normal tr {
    margin: 0;
    padding: 0;
    border: 0;
    border: 1px solid #999;
    width: 100%;
}

.Table-Normal tr td {
    margin: 0;
    padding: 4px 8px;
    border: 0;
    border: 1px solid #999;
}

.Table-Normal tbody tr:nth-child(2) {
    background-color: #EEE;
}
/* Tables */


推荐答案

中删除​​ display:block .Table-正常

Remove display: block in .Table-Normal

小提琴

.Table-Normal {
    position: relative;
    //display: block;
    margin: 10px auto;
    padding: 0;
    width: 100%;
    height: auto;
    border-collapse: collapse;
    text-align: center;
}

这篇关于表行未展开为全宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆