gridview not 100% width on page
am 15.01.2008 16:18:27 von psion
Hi,
We have a gridview on a webpage, which we would like to be 100% of the
table cell in which it is placed.
When we specify the width to be 100%, this has no effect, but only if
we specify a pixel number, i.e. 800, will the gridview be 800 px wide.
Here is an example:
http://www.valuetronics.com/Results.aspx?keywords=8050&x=0&y =0
And this may be related, but this page
http://www.valuetronics.com/Distributor_Products.aspx?mfgr=3 3
displays the grid at 100%, while
http://www.valuetronics.com/Distributor_Products.aspx?mfgr=3 111
does not, in either firefox or ie.
btw, using 1024 resolution will seem like the grid is 100% width, but
when switched to 1280, that's when I can see it.
Has anyone experienced this?
Thank you,
Krzysztof
RE: gridview not 100% width on page
am 15.01.2008 18:01:01 von brucebarker
with css there are two conflicting issues with sizing.
the default size of a parent object is the size of its contained children
plus margin and padding. when you make a child 100% of its parent, one of the
parents in the chain must have an absolute size, or the 100% is meanless (a
100% of what?) if no widths are set in the chain, the width becomes the width
of the body. tables are nore strict than divs in this area as the td's are
the size of the children
unlike width, body, has no default height, so for height 100% to work, you
need to specify an absolute height in the chain.
in your case, the table probably does not have a width, so the td does not
have a width:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
in green div - width of body
in yellow td - width of text as td has no width
|
-- bruce (sqlwork.com)
"psion" wrote:
> Hi,
> We have a gridview on a webpage, which we would like to be 100% of the
> table cell in which it is placed.
> When we specify the width to be 100%, this has no effect, but only if
> we specify a pixel number, i.e. 800, will the gridview be 800 px wide.
>
> Here is an example:
> http://www.valuetronics.com/Results.aspx?keywords=8050&x=0&y =0
>
> And this may be related, but this page
> http://www.valuetronics.com/Distributor_Products.aspx?mfgr=3 3
> displays the grid at 100%, while
> http://www.valuetronics.com/Distributor_Products.aspx?mfgr=3 111
> does not, in either firefox or ie.
>
> btw, using 1024 resolution will seem like the grid is 100% width, but
> when switched to 1280, that's when I can see it.
>
> Has anyone experienced this?
>
> Thank you,
> Krzysztof
>