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

时间:2022-09-12 08:55:46

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!

谢谢!

1 个解决方案

#1


22  

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>

#1


22  

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>