width of a table column

given

<table >
<tr><td width="20%">asddasd</td><td width="80%">dsdadds</td></tr></table>
when I check objectid.width I get "20%" and "80%".

What is this 20% and 80% of and how can I get the actual px of each ?
LVL 1
HalCHubAsked:
Who is Participating?
 
xtermieCommented:
0
 
GaryCommented:
You can't, percentages are proportional based on browser size. You could take a screenshot and then use something like Photoshop to get the actual size.
0
 
GaryCommented:
Addendum to my comment
That would be the actual size as of that instance, once you resize the browser those values (px) will change again.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
aprestoCommented:
Agreed, and apologies if i duplicate what is in the article posted. But unless you capture the size of the window at the time you cant do this. for example, window width = 1000, then:

1000 * 0.2 = 200 (0.2 being 20%)

But this is complicated because you would have to do this every time the window is resized which would include some ajax calls. On a windows form it wouldbt be a problem, on a web page its a completely different ball game.

Here is some javascript to the get window size, however by the sound of things you would need to manipulate it from the code behind which involves submitting this info to the server in order to do this, you could stick it in a hidden field and do it that way:

http://mauzon.com/how-to-get-real-window-width/

All together, not a recommened operation. What are you trying to achieve?
0
 
Wayne BarronAuthor, Web DeveloperCommented:
You could use it like this.
Give your Table Main, a set width, and then set the percentage between the 2 columns.
If I have misunderstood the question, please disregard.
Carrzkiss
<style type="text/css">
#MainTD{
	width:700px;
}
.tdR{
	width:80%;
}
.tdL{
	width:20%
}
</style>
</head>

<body>
<table id="MainTD">
<tr><td class="tdL">Something here</td><td class="tdR">Something here right here in the bigger area</td></tr>
</table>

Open in new window

0
 
HalCHubAuthor Commented:
so there is no way to query what the actual column width is when it is rendered ....
0
 
GaryCommented:
No the values are dynamic, all you could get is the width at load but that will change with browser size.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.