相关疑难解决方法(0)

不能在<td>标签上放置边距,既没有CSS也没有cellspacing属性

无论出于何种原因,我无法让任何表格单元格在它们之间有边距.我希望表格单元格具有灰色背景颜色(在白页背景上),因此它看起来像是在它们之间带有白色的图块.

我试过HTML,

<table cellspacing="3">
Run Code Online (Sandbox Code Playgroud)

同样在CSS中,

table td {
    margin:3px;
}
Run Code Online (Sandbox Code Playgroud)

什么都行不通.细胞仍然粘在一起,就像一个大灰色的斑点.我错过了非常基本的东西吗?

这是实际的代码:

<table width="100%" cellspacing="3">
    <tr>
        <th>Document Number</th>
        <th>BP Reference No.</th>
        <th>Posting Date</th>
        <th>Posting Week</th>
        <th>Customer/Vendor Code</th>
        <th>Customer/Vendor Name</th>
        <th>Item No.</th>
        <th>Item/Service Description</th>
        <th>Item Group</th>
        <th>Warehouse Code</th>
        <th>Remaining Open Quantity</th>
        <th>Line No.</th>
        <th>Sales Employee Name</th>
        <th>Stock</th>
        <th>Fill Rate</th>
        <th>1046</th>
        <th>1047</th>
        <th>1048</th>
        <th>1049</th>
        <th>1050</th>
        <th>1051</th>
        <th>1052</th>
        <th>1053</th>
        <th>1054</th>
        <th></th>
    </tr>
    <tr>
        <td>17272</td>
        <td>2244100</td>
        <td>5/24/2010</td>
        <td>22</td>
        <td>NYST</td>
        <td>NYSTROM INC.</td>
        <td>NYM118SX26DSTKS01</td>
        <td>Nystrom, Mort. 1-1/8'', Schl C~K, US26D, ST cam, 5pin, KS #43758</td>
        <td>Mort …
Run Code Online (Sandbox Code Playgroud)

html css html-table margin cellspacing

31
推荐指数
3
解决办法
9万
查看次数

标签 统计

cellspacing ×1

css ×1

html ×1

html-table ×1

margin ×1