Set height of td using jquery [Resolved]

Posted by Klbaiju under jQuery on 12/17/2015 | Points: 10 | Views : 443 | Status : [Member] | Replies : 5
Hi,

I want to change the the height of td in an html table by jquery

i tried this

$('#table tr td').css('height', '10px');

but not working

How to solve this

Regards

Baiju




Responses

Posted by: Webmaster on: 12/17/2015 [Administrator] HonoraryPlatinum | Points: 50

Up
3
Down

Resolved
@Klbaiju, to answer your question, looks like you can simply find the row and change the height instead of finding the column.

$('#table tr').css('height', '100px');

Here assuming that your table id is "table". Also remember that if you have somehow changed the height of 1 column, the entire rows height of that column will get changed.
$('#table tr td').css('height', '10px');
code snippet also looks good however see that your jquery selector is working fine, if it is then change the value from 10px to something else like 100px and you should be seeing the difference.

Thanks


Best regards,
Webmaster
http://www.dotnetfunda.com

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Webmaster on: 12/17/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
1
Down
@ProfessionalUser and @Rajeshatkitt, thanks for your response.

Instead of just copy-pasting the link, please provide the code snippet and describe it so that it would be easy for the post author to understand the subject and implement it.

Thanks for understanding.

Best regards,
Webmaster
http://www.dotnetfunda.com

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Alyssataylor on: 12/17/2015 [Member] Starter | Points: 25

Up
-1
Down
Change to this:

<table>
<tr>
<td height="50"> Hello World!!</td>
</tr>
</table>

www.auassignmenthelp.com/buy-assignments-online/


Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 12/17/2015 [Member] Starter | Points: 25

Up
-2
Down
http://stackoverflow.com/questions/8981271/jquery-dynamically-change-a-row-height-of-a-table

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response