Asra wrote:
Hello,
I have a table with width as 98% and all cell widths as 120. However,
these cell widths change with resolution changes. I have to find the
current cell width and its left position. Is there a browser
independent way to do that?
Best Regards,
Asra Baig
When you write the table, use server-side code to divide the number of
columns by 100 and make each column that percentage wide:
<table ... width="98%">
<tr>
<%
var numberOfColumns = <some calculation>;
var columnWidth = Math.floor(100 / numberOfColumns);
for (var i = 0; i < numberOfColumns; ++i) {
Response.write(
'<th width="' + columnWidth + '%">' +
columnNames[i] +
'</th>'
);
}
%>
</tr>
Now everything will scale nicely regardless of the browser width.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq