Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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 使用CSS设置表格样式_Html_Css - Fatal编程技术网

Html 使用CSS设置表格样式

Html 使用CSS设置表格样式,html,css,Html,Css,我有一个像这样的HTML表 <table> <tr> <td>Content</td> <td>Content</td> <td>Content</td> </tr>

我有一个像这样的HTML表

<table>
    <tr>
        <td>Content</td>                    
        <td>Content</td>                    
        <td>Content</td>                                        
    </tr>   
    <tr>
        <td>Content</td>                    
        <td>Content</td>                    
        <td>Content</td>                                        
    </tr>   
    <tr>
        <td>Content</td>                    
        <td>Content</td>                    
        <td>Content</td>                                        
    </tr>
</table>
但却没有得到我期望的结果。我不能在这个问题上使用内联样式

希望有人能帮助我


多谢各位

您可以使用
:last child
来实现它 试着用这个

table td:last-child
{
    border-right:none;
}
table tr:last-child td
{
    border-bottom:none;
}

您可以使用
:last child
来实现它 试着用这个

table td:last-child
{
    border-right:none;
}
table tr:last-child td
{
    border-bottom:none;
}

你几乎把它做好了

您需要将上一个
tr
中的
td
的边框设置为无,但您只需将该行的边框设置为无

table tr:last-child td {
     border-bottom: none; 
}

table td:last-child {
     border-right: none; 
}

你几乎把它做好了

您需要将上一个
tr
中的
td
的边框设置为无,但您只需将该行的边框设置为无

table tr:last-child td {
     border-bottom: none; 
}

table td:last-child {
     border-right: none; 
}
试试这个:

table td {
    padding: 20px 20px;
    width: 33%;
    border-bottom: 1px dashed #b4b4b4;
    border-right: 1px dashed #b4b4b4;
    background: #FFFDDC;
}
table td:last-child {
    border-right: 0;
}
table tr:last-child td {
    border-bottom: 0;
}
试试这个:

table td {
    padding: 20px 20px;
    width: 33%;
    border-bottom: 1px dashed #b4b4b4;
    border-right: 1px dashed #b4b4b4;
    background: #FFFDDC;
}
table td:last-child {
    border-right: 0;
}
table tr:last-child td {
    border-bottom: 0;
}

如果您不想使用
:last child
,并且您知道页面的背景色,请尝试添加以下内容:

table {
    border-collapse: collapse;
    border: 1px solid white;
}

如果您不想使用
:last child
,并且您知道页面的背景色,请尝试添加以下内容:

table {
    border-collapse: collapse;
    border: 1px solid white;
}

您可以将
:last child
:not
一起使用,而不是用
none
0
覆盖,如下所示:

表td{
填充:20px 20px;
宽度:33%;
垂直对齐:顶部;
}
表tr:非(最后一个孩子)td{
边框底部:1px虚线#b4;
}
表td:非(最后一个孩子){
右边框:1px虚线#b4;
}

请参见。

您可以将
:last child
:not
一起使用,而不是用
无或
覆盖,如下所示:

表td{
填充:20px 20px;
宽度:33%;
垂直对齐:顶部;
}
表tr:非(最后一个孩子)td{
边框底部:1px虚线#b4;
}
表td:非(最后一个孩子){
右边框:1px虚线#b4;
}

请参阅。

也尝试添加此-
tr:last child{border bottom:none;}
但没有Luckkalso尝试添加此-
tr:last child{border bottom:none;}
但没有luckthanks进行回复<代码>最后一个孩子
未在IE 7和8中工作。是吗?是的,
:最后一个孩子仅受IE9+支持。谢谢回复<代码>最后一个孩子
未在IE 7和8中工作。是吗?是的,
:最后一个孩子仅受IE9+支持。谢谢你的建议<代码>:not
对我来说是全新的。@TNK查看
:not
上的文档。谢谢你的建议<代码>:not
对我来说是全新的。@TNK查看
:not
上的文档。