开发者

How to scroll a table horizontally?

I have a table built from a dataset that is displayed in a partial view. The table is larger than the bowser.

How can开发者_开发问答 I get the table to scroll horizontally in my partial view?


How about something like:

<div style="width: 700px; overflow-x: auto;">
    <table>...</table>
</div>


One minor quibble overflow-x is a CSS3 property so not valid CSS2.1. If you define a width but not a height on a container div and then declare overflow:auto; then vertically the div will stretch but horizontally you will get a scroll bar.

so from the example in the answer above mine:

<div style="width: 700px; overflow: auto;">
       <table>...</table>
</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜