I want to set first TD height of every TR of one table to first TD height of Every TR of another table. I written the logic and everything works fine.
But, When i look at Layout of the TD, its height mentioned ad 50 but below code return 49. Because of that 1 px misalignment is there in the tables. I even tried TD.css("height)"; But no use. Why its returning 1px less. Any idea???????.... Please help.
var otherRowTD;
otherRowTD = $("#rightTable").find('tr:eq(' + rowNr + ')').find('td:first');
alert(otherRow.height());
mani2009it
Member
207 Points
82 Posts
Jquery height() not working as expected.
Feb 24, 2012 07:50 AM|LINK
I want to set first TD height of every TR of one table to first TD height of Every TR of another table. I written the logic and everything works fine.
But, When i look at Layout of the TD, its height mentioned ad 50 but below code return 49. Because of that 1 px misalignment is there in the tables. I even tried TD.css("height)"; But no use. Why its returning 1px less. Any idea???????.... Please help.
var otherRowTD; otherRowTD = $("#rightTable").find('tr:eq(' + rowNr + ')').find('td:first'); alert(otherRow.height());asteranup
All-Star
30184 Points
4906 Posts
Re: Jquery height() not working as expected.
Feb 24, 2012 08:02 AM|LINK
Hi,
This may be due to in one table the cell has porder top or bottom and in one there is no border. This is just a guess.
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: Jquery height() not working as expected.
Feb 24, 2012 08:03 AM|LINK
Dear friend,
Height method caluculates the height but without the padding and the margin, make sure that these values are 0
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.