开发者

How to scroll a table horizontally?

开发者 https://www.devze.com 2023-01-22 10:38 出处:网络
I have a table built from a dataset that is displayed in a partial view. The table is larger than the bowser.

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

精彩评论

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

关注公众号