Reputation: 1030
<td id="test_1"></td>
This is my td element inside the table element and I want to add width to it using jquery I used
$('#test_' + 1).attr('width','256px');
But it is not working not adding width to the element nor showing any error in console
please help
Upvotes: 0
Views: 30
Reputation: 1118
The attr
method is not designed for this usually I am doing this with .css("width", "256px")
EDIT: I have noticed you have added the "px" string at the end, if you remove the px from the end the attr
should work also.
Upvotes: 1