简体   繁体   English

如何制作按钮填充表格单元格

[英]How to make button fill table cell

I have this HTML ... 我有这个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 ... ...导致表格和按钮看起来像这样......

没有填表的按钮

... which is fine, but how would I make the button fill the entire cell? ...这很好,但是如何让按钮填满整个单元?

Thanks! 谢谢!

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. 请注意,如果输入按钮的宽度为100%,则不再需要属性“align ='center'”。

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM