views:

21

answers:

2

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?

+1  A: 

How about something like:

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

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>
antonlavey