0

我需要你的帮助,

如何在表格的最后一列标题中添加一个border-right: 1px solid #808080?我不确定并坚持要修改或修复什么。

这是我的 CSS 和粘贴 Bin: http: //pastebin.com/CEPVfd1z

CSS:

#wrapper {
        height: 150px;
        width: 800px;
        border: 1px solid #808080;
        position: relative;

        overflow-y: scroll;
        overflow-x: scroll;
        scrollbar-base-color: #DFDFDF;
        scrollbar-arrow-color: #235A81;

}
#data {
  border-collapse: collapse;
  border: 0;
  width: 800px;
}
#data th {
  border-left: 1px solid #808080;
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#cdcdcd");
}
#data td {
  border: 1px solid #808080;
}
#data tr:first-child th {
  border-top: 0;
}
#data tr:last-child td {
  border-bottom: 0;
}
#data tr td:first-child,
#data tr th:first-child {
  border-left: 0;
}
4

1 回答 1

1

#data th:last-child用作选择器,然后将属性border-right添加到其中。好像你已经知道如何使用:first-child:last-child选择器了,我就不解释了。

http://jsfiddle.net/KgXuN/

#data th:last-child {
    border-right: 2px solid red;
}
于 2013-03-07T19:58:37.570 回答