引导表扩展到右侧的容器之外

引导表扩展到右侧的容器之外

本文介绍了Twitter 引导表扩展到右侧的容器之外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Twitter Bootstrap 中有一个表,当该表有很多列(大约 19-20 列,具体取决于其中的内容)时,它会延伸到 .container 之外.

I have a table inside of a Twitter Bootstrap, and when the table has a lot of columns (around 19-20 depending on whats inside them) it extends outside of the .container.

hr 标签(表格下方的灰线)定义了 .container 的边缘.桌子总是向右延伸过去.

The hr tag (gray line underneath table) defines the edges of the .container. The table always extends past it to the right.

是否可以将表格居中,使其两侧均等地延伸到 .container 之外?

推荐答案

我遇到了同样的问题.结果是容器的宽度小于桌子的宽度.如果您使用的是 Chrome,那么开发者工具非常棒.

I had the same problem. It turned that the container's width was smaller than the table's width. If you're using Chrome, the Developer tools are pretty awesome.

作为临时修复,我只是将其设置为大于我的桌子宽度.我的表格宽度当前为 1079 像素.

I just set it to larger than my table's width, as a temporary fix. My table's width is current 1079px.

.container { width: 1200px; }

当我将表格的宽度增加到 1132 像素时,它又开始向右漂移.我将尝试减小内容的宽度,但这是一个难题.可折叠的列可能是一个东西,并且有水平滚动,但这似乎对数据有更多的障碍.

When I increased the table's width to 1132px it started to drift to the right again. I'm going to try decreasing the width of the contents, but it's a difficult problem. Collapsible columns are probably a thing and there's horizontal scroll, but that just seems like more barriers to the data.

这篇关于Twitter 引导表扩展到右侧的容器之外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 03:37