sizeable grid

J

Jesse Aufiero

I was wondering if anyone knows how to get a datagrid to size as the browser
is resized such that the datagrid's borders would appear anchored to the
browser edges. The datagrid should have a white-space border around it and
scrollbars should automatically appear on the datagrid should the contents
of the grid spill outside of the viewable area.



I have gotten this to work for the IE browser by placing a DIV tag around
the datatable (shown below). And to maintain a margin of white space around
each edge of the grid as the browser is resized, I placed the DIV section
inside of a table, with rows and columns that maintain the white-space
margin around the grid, and whose center cell is set to a height and width
of 100%.



a snippet...



<TD align="right" width="100%" height="100%">

<DIV style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%">

{Datatable}

</DIV>

</TD>



....but this code does not work in a Mozilla/Firefox browser. Instead, the
datagrid extends well beyond the browser's right and bottom edges, causing
unwanted browser scrollbars to appear.



I know there must be a way around this, perhaps by using style sheets. But
I'm not sure what next steps to take.
 
S

S. Justin Gengo

Jesse,

Set the grids contents to allow wrapping and then set the grid's width to a
percentage.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
J

Jesse Aufiero

Unfortunately one of my requirements, for reasons of legibility, is to leave
the grids contents unwrapped. Hence the need for scrollbars when the
contents of the grid inevitably extend beyond the viewable area.
 
B

Bruce Barker

this is a bug in IE, might be fixed in the next release.

while the browser tries to make the body width equal the frame width, it
makes no attempt on the height. thus on the <div style="height=100%;">, it
is setting the div's height to the parents height. in this case the parent
is the body, whose height is auto (size of content), this make the div's
height auto also, so no scrollbars are needed. you to need to set the height
of the div parents, so that it can calc a size smaller than the frame.

add this line:

<style type="text/css">html, body{height:100%}</style>


-- bruce (sqlwork.com)
 
J

Jesse Aufiero

Thanks for the comprehensive answer. Had I asked you a few days ago I could
have saved myself hours of google searches. But actually, I have already
seen all three of these pages and, after applying what I learned from them,
I'm still having issues. I'm not quite sure what to do next here. But
thank you for the info.

Probably what I need is someone who has gone through this exact problem
before, but finding that person will be hard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top