It is technically possible to make a tr
element focusable, on sufficiently new browsers, by using a tabindex
attribute on it, e.g. <tr tabindex="1">
.
However, the method of focusing is browser-dependent, and focusable table rows can be a usability nightmare. For example, both on IE and on Firefox, the row is focused on when the TAB key is used suitably, but a focused row does not take input. The use would need to hit TAB again to get to the input field. On Firefox, but not on IE, the row can also be focused on by clicking, though not by clicking on the input field (since that would focus on that field). If you use label
markup, as recommendable for usability and accessibility, e.g.
<table>
<tr tabindex="1">
<td><label for="name">Name</label></td>
<td><input type="text" name="name" id="name"></td>
</tr>
</table>
… then clicking on the label focuses on the input field (one of the reasons for using label
markup!), not on the row element.