I have a table with checkboxes in it, and the cells in each checkbox row contain information about what that checkbox is about. So I wanted to use label for the rows but, as far as I know, you can't use label between table and td tags.
Then I made a CSS-table version of the same thing and it worked properly. I styled label as a table-row, the cells were properly aligned, and clicking them would check/uncheck the checkbox.
Now the problem: I want the checkbox to span across multiple rows.
http://jsfiddle.net/odraencoded/YaS5v/ - The HTML table version has the rowspan attribute, but I can't use label in a single row let alone multiple rows.
<table>
<tr>
<td rowspan=2><input type=checkbox /></td>
<td>...</td>
</tr>
<tr><td>...</td></tr>
</table>
http://jsfiddle.net/odraencoded/EKzXv/ - The CSS table version lets me use label but I can't find a way to set the rowspan.
<div style="display: table;">
<label style="display: table-row-group;">
<span style="display: table-row;">
<span style="display: table-cell;">
<input type="checkbox" />
</span>
<span...>...</span>
</span>
<span...><span...>...</span></span>
</label>
</div>
Is there any way to have a label tag containing multiple rows? And one of the cells it contains is the input checkbox the label is for? And that input checkbox cell should span across all rows contained by the label? Anyway for that?
<TH>
? – bobthyasian<label>
works? Could you make a mock-up of what it is you want? I'm still in the dark. You can't have a<TD>
that transcends<TR>
...That goes against the whole point of tables. You'd want to go full<DIV>
. – bobthyasian<label>
uses an attribute calledfor
. It links the<label>
with the desired<input>
Source – bobthyasian