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

Thread: set row height

  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    set row height

    Hello, I am wondering why I cannot set my row heights via jscript. The situation is that I have 2 tables that sit side by side. I cannot combine them, or I would have done that long ago So, I am trying to implement a javascript solution. I want the row heights to adjust to line up when a row is put into edit mode and I want the header rows to match up. the header row on the second table gridHCSprea is much taller. Can someone please poitn me in the right direction as to why this is not working? TIA

    Code:
    function setHCGrids(){
    				var x=document.getElementById('gridHCPosition').rows;
    				var y=document.getElementById('gridHCSpread').rows;
    				x[0].height = y[0].height;
    				for (i=1; i<x.length; i++)
    				{
    					x[i].height = y[i].height;
    				}
    
                }
    Last edited by hedidit; 07-31-2008 at 11:27 PM.

  • #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
    Maybe:
    Code:
    var x=document.getElementById('gridHCPosition').getElementsByTagName('tr');
    var y=document.getElementById('gridHCSpread').getElementsByTagName('tr');
    for(var i=0;i<x.length;i++){
    x[i].style.height=y[i].offsetHeight+'px'
    }
    But you should know that a row takes anyway the height of its higher cell, if the cell has set a height (or the text inside the cell overpasses the tr height)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • Users who have thanked Kor for this post:

    hedidit (08-01-2008)

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kor View Post
    Maybe:
    Code:
    var x=document.getElementById('gridHCPosition').getElementsByTagName('tr');
    var y=document.getElementById('gridHCSpread').getElementsByTagName('tr');
    for(var i=0;i<x.length;i++){
    x[i].style.height=y[i].offsetHeight+'px'
    }
    But you should know that a row takes anyway the height of its higher cell, if the cell has set a height (or the text inside the cell overpasses the tr height)
    Thank you so much. I am making the transition from desktop to web dev and I am having a time with Jscript. Again, thanks for your help.


  •  

    Posting Permissions

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