Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make button fill table cell

Tags:

html

I have this HTML ...

<p align='center'>
<table width='100%'>
<tr>
<td align='center'><form><input type=submit value="click me"></form></td>
</tr>
</table>
</p>

... which results in a table and button that looks like this ...

button that does not fill table

... which is fine, but how would I make the button fill the entire cell?

Thanks!

like image 646
Red Cricket Avatar asked Sep 11 '12 04:09

Red Cricket


1 Answers

For starters:

<p align='center'>
<table width='100%'>
<tr>
<td align='center'><form><input type=submit value="click me" style="width:100%"></form></td>
</tr>
</table>
</p>

Note, if the width of the input button is 100%, you wont need the attribute "align='center'" anymore.

This would be the optimal solution:

<p align='center'>
<table width='100%'>
<tr>
<td><form><input type=submit value="click me" style="width:100%"></form></td>
</tr>
</table>
</p>
like image 82
Solo Avatar answered Oct 19 '22 09:10

Solo