How to have a table scroll only within a custom control on page? CSS help needed


Tags: jquery,asp.net,css,gridview

Problem :

I have a custom control(ascx) that has some text plus a gridview. Here is what I'm trying to do. I want an table(with some information) within a div tag to scroll beside the gridview within the custom control. I don't what the table to scroll down the whole page. I don't have paging on the gridview because the user needs to see everything within one browser window.

I tried playing around with position value of fixed, absolute and relative. I placed the gridview within a div tag that had a value of position:relative and another div tag embedded within the main div tag with a value of position:fixed and left:70%. I get a partial result that I'm trying to achieve. Any help would be appreciated.



Solution :

I had similar requirement in my project and i achieved it by having a div tag with specific with then set overflow to auto

<div id ="mydiv" style ="width: 1000px;overflow:auto"/>

you may set the height to a specific width.


    CSS Howto..

    CSS: how to keep image never modified with same “offset” all the time?

    How do you design your CSS?

    How to make CSS visible only for Android phone UC browser

    How to count the number of correct answers using Javascript?

    How to position the GWT dialog to the bottom right corner of the browser?

    How to overlap images in the header section?

    How to reduce spacing between navigation links CSS

    How to stop children from clipping when using dynamic height parents?

    How Is This Effect Achieved? HTML/CSS/jQuery [closed]

    How can I add fixed background just to this section? [demo included]

    CSS: How to make background of an element stretch across the entire page?

    How to change the CSS of entire page/website on click?

    How to get the first ClassB inside ClassA?

    How to set the default font in Google Closure Library rich text editor

    Showing images in placeholder on focus

    How to add hover effect to menu using jQuery

    How to apply multiple css radial gradients to a single element

    How to add !important to every element in a CSS file [duplicate]

    How can I apply CSS selector to attribute values being case sensitive?

    how do i align contact form 7 next to text

    How to place two canvases adjacent to each other and on top of a third one

    How to rotate an image by a random amount using CSS?

    Make nav dropdown show above all other divs

    How can I handle XML namespaces in CSS Selectors or in jQuery?

    How to include image into css file using JSF tag

    How is it possible to modify the gap between a bullet and its list text?

    How to apply a CSS height setting to all child elements?

    How to use different kind of Google Font types?

    How to get similar effect on menu

    How do I animate this box to have a pop out effect?