如何正确地将滚动条放在桌子旁边?(How to correctly place scroll bar next to the table?)
我的问题很简单。 在这个jsfiddle: http : //jsfiddle.net/nyCKE/2/我有一个atable包含一个滚动条,表格滚动固定标题。 但我的问题是我不希望滚动条显示在最后一列的下面,我希望它显示在最后一列的旁边,这样它就不会占用最后一列表旁边的空格。 但是为了能够做到这一点,我还需要更改css / html?
以下是HTML:
<table> <thead> <tr> <td>Problem</td> <td>Solution</td> </tr> </thead> <tbody> </tbody> </table>下面是CSS:
table { background-color: #aaa; } tbody { background-color: #ddd; height: 100px; overflow: auto; } td { padding: 3px 10px; } thead > tr, tbody{ display:block;}My question is simple. In this jsfiddle: http://jsfiddle.net/nyCKE/2/ I have a atable which contains a scroll bar and the table scrolls with fixed headers. But what my question is that I don't want the scroll bar to be displayed underneath the last column as it is, I want it displayed next to the last column so that it does not take up some space next to the last table column. But what do I need to change css/html in order to be able to do this?
Below is HTML:
<table> <thead> <tr> <td>Problem</td> <td>Solution</td> </tr> </thead> <tbody> </tbody> </table>Below is CSS:
table { background-color: #aaa; } tbody { background-color: #ddd; height: 100px; overflow: auto; } td { padding: 3px 10px; } thead > tr, tbody{ display:block;}最满意答案
tbody{ width: 110%; }这需要进行测试
tbody{ width: 110%; }This needs to be tested though
更多推荐
发布评论