Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 设置表格单元格间距颜色_Html_Css_Html Table - Fatal编程技术网

Html 设置表格单元格间距颜色

Html 设置表格单元格间距颜色,html,css,html-table,Html,Css,Html Table,我有一张桌子,上面有一张图片作为背景图片 我想将单元格间距颜色设置为白色,使列看起来是分开的 但是,我无法设置背景色,因为它也会影响背景色,我希望背景色保持透明 每个都有自己的边框颜色,因此我无法将其边框颜色调整为白色 <div id="container"> <img id="mybackgroundimage" /> <table id="table"> <tr> <td class="green">&l

我有一张桌子,上面有一张图片作为背景图片

我想将单元格间距颜色设置为白色,使列看起来是分开的

但是,我无法设置
背景色,因为它也会影响
背景色,我希望背景色保持透明

每个
都有自己的边框颜色,因此我无法将其边框颜色调整为白色

<div id="container">
  <img id="mybackgroundimage" />
  <table id="table">
    <tr>
      <td class="green"></td>
      <td class="green"></td>
      <td class="red"></td>
    </tr>
    <tr>
      <td class="red"></td>
      <td class="green"></td>
      <td class="red"></td>
    </tr>
 </table>
</div>




        #container{
            position: relative;
        }

        #table {
            border-spacing: 2px;
            position: absolute;
            top: 0;
        }

           #table td.green {
               border-color: green;
           }

           #table td.red {
               border-color: red;
           }

#容器{
位置:相对位置;
}
#桌子{
边界间距:2px;
位置:绝对位置;
排名:0;
}
#表td.green{
边框颜色:绿色;
}
#表td.red{
边框颜色:红色;
}

有人能给我建议吗

如果我理解的很好,您只想在表中放置一个背景图像,然后折叠边框

在这里,我将背景色设置为红色,但您也可以使用图像

表,th,td{
边框:2倍纯白;
边界塌陷:塌陷;
}

AAA
AAA

如果我理解得很好,您只想在表中放置一个背景图像,然后折叠边框

在这里,我将背景色设置为红色,但您也可以使用图像

表,th,td{
边框:2倍纯白;
边界塌陷:塌陷;
}

AAA
AAA
.row1{
边框:15px纯白
}
.row2{
边框:15px纯白
}

一月至二月
三月四月
.row1{
边框:15px纯白
}
.row2{
边框:15px纯白
}

一月至二月
三月四月

选项1:对单元格使用实心轮廓

#表{
边界间距:2px;
位置:绝对位置;
排名:0;
}
#表td{
外形:2个实心#ccc;
}
#表td.green{
边框:1px纯绿色;
}
#表td.red{
边框:1px纯红;
}

第一单元
第二单元
第三牢房
第四单元

选项1:对单元格使用实心轮廓

#表{
边界间距:2px;
位置:绝对位置;
排名:0;
}
#表td{
外形:2个实心#ccc;
}
#表td.green{
边框:1px纯绿色;
}
#表td.red{
边框:1px纯红;
}

第一单元
第二单元
第三牢房
第四单元

HTML代码(如果可能)HTML代码(如果可能)