HTML 關於 Form 與 Table 的結構

2015-08-17

有關form標籤在IE中的使用注意事項:

If you try to add a form warping a tr element like this

<table>
<form>
<tr>
<td><input type="text"/></td>
<td><input type="submit"/></td>
</tr>
</form>
</table>

some browsers in the process of rendering will close form tag right after the declaration leaving inputs outside of the element something like this

<table>
    <form></form>
    <tr>
    <td><input type="text"/></td>
    <td><input type="submit"/></td>
    </tr>
    </table>

This issue is still valid for warping multiple table cells

Nesting tables are a possible solution which is not recommended. Avoid using tables.

It should write like below to avoid this issue

<form>
<table>
<tr>
<td><input type="text"/></td>
<td><input type="submit"/></td>
</tr>
</table>
</form>

Contact

Github

Codepen

歡迎參觀我的賣場
© 2013 Copyright Digishot Web | Design Tools
Visitors【719361】
digishot webdesign studio