Reputation: 739
How can I make an HTML <button>
vertifically fill a Table Cell with CSS?
I can use width:100%
to make the button horizontally fill a Table Cell with CSS, but height:100%
doesn't do anything.
For an example, please see: http://jsfiddle.net/eA5fQ/
Thanks!
Upvotes: 8
Views: 12952
Reputation: 470
Add height:100%;
to your button and set height of your td tag in percents
Upvotes: 3
Reputation: 1459
If you use min-height: 1px;
as well as height: 100%;
it seems to work fine: http://jsfiddle.net/jJbCd/8/
Upvotes: -2
Reputation: 36619
If you don't mind a jQuery solution:
$('#button1').css('height', $('#button1').parent('td').height());
Upvotes: 4
Reputation: 22266
You'll need to specify the height in pixels as in:
height: 100px;
Upvotes: 3