Saturday, March 31, 2012

table with a scrollbar?

I have a user control (HTML table) within a table. Would it be possible to
cause the user control to scroll its conents when its container is too
small, or will I just have to make its height = 100% so it can't cause its
container to resize too big?

PaulYou can put your table (or any control) into a fixed size area by putting it
in a scrollable div such as this:

<div id="Layer1" style="position:relative;width:350px;height:200px;overflo w:
scroll;">control goes here</div
The key is to use the "overflow" CSS attribute.Here's more info:
http://www.w3schools.com/css/pr_pos_overflow.asp

Another option is to put your control in an IFrame.
http://msdn.microsoft.com/workshop/...ects/IFRAME.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul
Thanks, that's exactly what I was looking for.

Paul

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eI5ghT3oFHA.3912@.TK2MSFTNGP10.phx.gbl...
> You can put your table (or any control) into a fixed size area by putting
> it in a scrollable div such as this:
> <div id="Layer1"
> style="position:relative;width:350px;height:200px;overflo w:
> scroll;">control goes here</div>
> The key is to use the "overflow" CSS attribute.Here's more info:
> http://www.w3schools.com/css/pr_pos_overflow.asp
> Another option is to put your control in an IFrame.
> http://msdn.microsoft.com/workshop/...ects/IFRAME.asp
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "PJ6" <nobody@.nowhere.net> wrote in message
> news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>>I have a user control (HTML table) within a table. Would it be possible to
>>cause the user control to scroll its conents when its container is too
>>small, or will I just have to make its height = 100% so it can't cause its
>>container to resize too big?
>>
>> Paul
>>
You may also find this useful. Freeze columns and rows
like Excel but in your html table:

http://www.eggheadcafe.com/articles...ver_control.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#

Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"PJ6" <nobody@.nowhere.net> wrote in message
news:%23EMq6P3oFHA.3760@.TK2MSFTNGP15.phx.gbl...
>I have a user control (HTML table) within a table. Would it be possible to
>cause the user control to scroll its conents when its container is too
>small, or will I just have to make its height = 100% so it can't cause its
>container to resize too big?
> Paul

0 comments:

Post a Comment