表格的右边框不止于上一列的边框

时间:2019-12-11 12:58:55

标签: html css

我的右侧桌子边框比最后一栏更远(浅灰色线是我的边框),请参见下图: Image

这是表格的CSS代码:

        table.tableizer-table {
            font-size: 12px;
            border: 1px solid #CCC;
            font-family: Arial, Helvetica, sans-serif;
        }

td和th,请参见下文:

        .tableizer-table td {
            padding: 4px;
            margin: 3px;
            border: 1px solid #CCC;
        }

        .tableizer-table th {
            background-color: #1e73be;
            color: #FFF;
            font-weight: bold;
        }

HTML:

<table style="display:none;" class="tableizer-table" id="tableMonths">

这是我在JS中所做的:

document.getElementById('tableMonths').style.display = 'block';

有人知道为什么会出现此问题吗?

1 个答案:

答案 0 :(得分:0)

看起来您代码的其他地方在表上都有“显示:块”,这使其占据了整个宽度。尝试检查它,并将其值更改为“ inline”。