...

View Full Version : table header cell width



lebronletchev
07-10-2007, 04:24 PM
Hi,

Could I determine the width using a function?

If for example I do following:

<TH bgcolor="#FFFFCC" valign=right width=40%><%response.write rs.fields("keywords") %></TH>

Could I determine the width of Table header cell based on size of rs.fields("keywords") ?

Thanks for any help

Lebron

Kor
07-10-2007, 10:11 PM
the width of your header is already set to 40% of whichever could be your table (or nesting DIV) length... What is your final aim, anyway?

Off the topic: You should better use CSS to set the elements' presentation.

rwedge
07-11-2007, 01:44 AM
To return the value in pixels:
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="middle">
<th bgcolor="#FFFFCC" align="right"><%response.write rs.fields("keywords") %></th>
</tr>
</table>

<script type="text/javascript">
alert(document.getElementsByTagName('TH')[0].offsetWidth);
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum