d-man
d-man

Reputation: 58063

HTML table with 100% overflow scroll for table only

I am trying to have table having width of size of screen and overflow should be scroll bar rather then whole page gets scroll bar.

Currently following code generates the scroll bar for the whole page rather then scroll bar only for table.

any help is appreciated.

I have table which generates dynamic length

<table width="100%" style="overflow:none">
<tr>

for 1 ... n
<td></td>

</tr>
</table>


end for

Upvotes: 0

Views: 113

Answers (1)

LOTUSMS
LOTUSMS

Reputation: 10240

Give this page you are working with an ID, and give this ID the overflow:hidden. That way other pages can still have overflow in their body. See DEMO

    body{
        width:100%, 
        overflow: hidden;
    }

    div.scrollWrapper{
        height:250px;
        overflow:scroll;
    }
    div.scrollWrapper table{
        width:100%;
    }

Upvotes: 1

Related Questions