简体   繁体   English

CSS为表添加边框

[英]CSS adds border to table

Please refer to this JSFiddle 请参考这个JSFiddle

The issue is in Firefox there is a border down the left side of the table and in Chrome and Safari the border goes down the right side of the table. 问题是在Firefox中,桌子的左侧有一个边框,而在Chrome和Safari中,边框位于桌子的右侧。 I don't want the border down the side at all, only on the table header row. 我根本不希望边框边缘,只在桌面标题行。

I can't seem to get rid of it. 我似乎无法摆脱它。 Does anyone have any suggestions on how I can go about diagnosing this? 有没有人对我如何诊断这个有任何建议?

Here's my CSS: 这是我的CSS:

body {background-color:black;}

table.tablesorter {
    font-family:arial;
    background-color: #CDCDCD;
    margin:10px 0pt 15px;
    font-size: 12pt;
    width: 100%;
    text-align: left;
    border-collapse: collapse;

}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
    background-color: #e6EEEE;
    border: 1px solid #FFF;
    font-size: 10pt;
    padding: 4px;
}
table.tablesorter thead tr .header {
    background: url(http://tablesorter.com/themes/blue/bg.gif) no-repeat 99%;
    background-repeat: no-repeat;
    background-position: center right;
    cursor: pointer;
}
table.tablesorter tbody td {
    color: white;
    padding: 4px;
    background-color: #FFF;
    vertical-align: top;
}
table.tablesorter thead tr .headerSortUp {
    background: url(http://tablesorter.com/themes/blue/desc.gif) no-repeat 99%;
}
table.tablesorter thead tr .headerSortDown {
    background: url(http://tablesorter.com/themes/blue/asc.gif) no-repeat 99%;
}
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
    background-color: #8dbdd8;
}
table.tablesorter tr.parent-row > td {

    /* IE10 Consumer Preview */
    background-image: -ms-linear-gradient(bottom, #253355 0%, #587993 100%);
    /* Mozilla Firefox */
    background-image: -moz-linear-gradient(bottom, #253355 0%, #587993 100%);
    /* Opera */
    background-image: -o-linear-gradient(bottom, #253355 0%, #587993 100%);
    /* Webkit (Safari/Chrome 10) */
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #253355), color-stop(1, #587993));
    /* Webkit (Chrome 11+) */
    background-image: -webkit-linear-gradient(bottom, #253355 0%, #587993 100%);
    /* W3C Markup, IE10 Release Preview */
    background-image: linear-gradient(to top, #253355 0%, #587993 100%);
    border: 0px;
    border-collapse: collapse;
}

table.tablesorter tr.parent-row-details > td {
    background: black;
    border: 0px;
    border-collapse: collapse;
}
table.tablesorter-child thead tr th, table.tablesorter tfoot tr th {
    background-color: #e6E66E;
    border: 1px solid #000;
    font-size: 18pt;
    padding: 4px;
}
table.tablesorter-child tbody tr td {
    color: black;
}

table.tablesorter tbody tr.parent-row {
    font-size: 12px;
    vertical-align: center;
}
table.tablesorter tbody tr.parent-row td {
    vertical-align: middle;
}

td.tdd { 
    horizontal-align:right;
}

.arrow-rotate {
    -moz-transform: rotate(90deg);
    -webkit-transform:rotate(90deg); 
    -ms-transform:rotate(90deg);
    -o-transform:rotate(90deg);
}

Thanks! 谢谢!

The border color is coming from this tag: 边框颜色来自此标记:

table.tablesorter {
    background-color: #CDCDCD;
}

If you remove it, and then get rid of the background image in this one: 如果你删除它,然后摆脱这一个背景图像:

table.tablesorter thead tr .header {
  background: url("http://tablesorter.com/themes/blue/bg.gif") no-repeat scroll right center rgba(0, 0, 0, 0);
} 

and then change the background color on this one to the #CDCDCD 然后将此背景颜色更改为#CDCDCD

table.tablesorter thead tr th, table.tablesorter tfoot tr th {
  background-color: #cdcdcd;
}

You should see something like what you are looking for. 你应该看到类似你想要的东西。

DEMO DEMO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM