Is <form> valid over <tr>?

Is the following valid HTML? I am particularly interested in knowing the location of the tag <form>.

<table>
    <form>
        <tr>
            <td>
                <input id="txt" type="text"></input>
            </td>
            <td>
                <input id="txt" type="text"></input>
            </td>
            <td>
                <input type="submit"></input>
            </td>
        </tr>
    </form>
</table>
+5
source share
5 answers

I repeat using the w3c validator http://validator.w3.org/ . And there is none of it invalid :-)

+11
source

Not valid. I assume that you want to remove the default padding of the form element. This is best done using CSS:

form {
    padding:0;
    margin:0;
}

or

<form style="padding:0;margin:0;">

, ( , CSS ). . , , , .;)

+8

, , TABLE TBODY, THEAD, TFOOT, CAPTION, COL, COLGROUP. XHTML, tr TABLE.

+3

. . http://www.w3.org/TR/html4/struct/tables.html#edef-TABLE

<!ELEMENT TABLE - -
 (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)> 

An item <form>can appear in all places where you can have content block. Therefore, <form>there can be in <body>, <blockquote>, <noscript>(oddly enough, also <map>). As blockcan also be in flow, it can also appear in the <div>, <ins>, <del>, <dd>, <li>, <td>,<th>

+2
source

This is not correct HTML, but sometimes it is done to lose empty lines.

-3
source

All Articles