Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unhappy table header cell width

    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

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    To return the value in pixels:
    Code:
    <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>
    Last edited by rwedge; 07-11-2007 at 03:02 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •