I have a table in a page that consists of checkboxes in the cells on the left and descriptions in the cells on the right. The \"description\" contains h4 headers and plain t
Only inline elements (except other label elements) may appear inside label elements.
<!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
— http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1
It doesn't make sense to put headings there anyway.
The <label>
element in HTML is an inline level element and cannot contain block level elements.
This is probably what's causing your issues. Alternatively you can put your labels inside the <h4>
's :
<tr><td><input type="checkbox" name="entiries[]" value="i1" id="i1"></td>
<td><
<h4><label for="i1">Some stuff</label></h4>more stuff..
<h4><label for="i1">Some stuff</label></h4>more stuff..
</label>
</td></tr>
Block level elements (to which h4
belongs) are not allowed inside inline elements, and will cause undefined behaviour. You can use span
elements instead.