表格默认不占据 100% 的宽度。您需要专门定义它:
<table style="width:100%">
<tbody>
<tr>
<td colspan="2" align="center"><input type="image" src="https://my.payfast.io/images/buttons/Subscribe/Dark-Large-Subscribe.png" alt="Subscribe" title="Subscribe with Payfast" /></td>
</tr>
</tbody>
</table>
此外,我建议一个简单的
<div style="text-align:center">
insetad。
默认情况下,表格元素不会遮挡父元素的全角。只需将表格宽度设置为 100%,按钮就会水平居中对齐。
<table style="width: 100%">
<tbody>
<tr>
<td colspan="2" align="center"><input type="image" src="https://my.payfast.io/images/buttons/Subscribe/Dark-Large-Subscribe.png" alt="Subscribe" title="Subscribe with Payfast" /></td>
</tr>
</tbody>
</table>