如何正确地将滚动条放在桌子旁边?(How to correctly place scroll bar next to the table?)

编程入门 行业动态 更新时间:2024-10-26 13:29:09
如何正确地将滚动条放在桌子旁边?(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

更多推荐

本文发布于:2023-08-05 17:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1437492.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:放在   正确地   滚动条   桌子   correctly

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!