473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

gridview not 100% width on page

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....s=8050&x=0&y=0

And this may be related, but this page
http://www.valuetronics.com/Distribu...s.aspx?mfgr=33
displays the grid at 100%, while
http://www.valuetronics.com/Distribu...aspx?mfgr=3111
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
Jan 15 '08 #1
1 10804
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:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div style="background:red;">
<div style="width:100%; background:green;">
in green div - width of body
</div>
<table>
<tr>
<td>
<div style="width:100%; background:yellow;">
in yellow td - width of text as td has no width
</div>
</td>
</tr>
</table>
</div>
</body>
</html>


-- 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....s=8050&x=0&y=0

And this may be related, but this page
http://www.valuetronics.com/Distribu...s.aspx?mfgr=33
displays the grid at 100%, while
http://www.valuetronics.com/Distribu...aspx?mfgr=3111
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
Jan 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row...
0
by: John Smith | last post by:
If anyone can help, I would very muchly appreciate it. I have a main page that uses the .net 2.0 menu control with the multiview controls as the menu choices. This works fine. One of the menu...
4
by: Chuck | last post by:
I'm setting the column with for a gridview (25+- columns) and have paging turned on. When the gridview is first displayed, the column widths are all set to the default. But after paging to...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
1
by: gary.comstock | last post by:
We have a non asp web page that contains a hyperlink which opens an iframe. The iframe is hidden until the hyperlink is selected then javascript toggles the visibility to 'visible'. Inside the...
3
by: dhaneshrs | last post by:
I have a gridview i managed to update using the edit option in the smartmenu. The problem comes when i delete a value or make a value read only. Say i have a table Employee with the following...
2
by: psion | last post by:
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...
0
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
7
by: shanthidiana | last post by:
hi All, I am new to dot net... i am learning it and I am doing my masters project in c# dot net with sql server 2000 backend... The issue i am having now is... i am having a gridview, upon...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.