Form tag won't enclose elements inside a table

牧云@^-^@ 提交于 2019-11-30 18:18:21

You cannot interrupt the <table> structure with any tags besides <thead>, <tfoot>, <tbody>, <tr>, <th>, or <td>. You form tags need to be encapsulated between two <td> or your entire <table> needs to be placed within the <form> tag.

<table>
    <tr>
        <td>
            <form>
            ...form data...
            </form>
        </td>
    </tr>
</table>

..or..

<form>
    <table>
    ...
    </table>
</form>

you can only put a form inside a td basically, so you could put those 2 rows inside a new table that you create inside a td
like ...

<table><tr><td><form><table><tr>...</tr><tr>...</tr></table></form></td></tr><tr>...</tr><tr>...</tr></table>

The <form> tag can only be placed inside a <td> element or outside the <table> in this case.

If I were you, I'd just put the <form> around the whole table since you said there won't be any other forms within it.

Or, you could replace the <table> completely with <div>s instead that use display: table; or display: table-cell;.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!