JSFiddle - React, Tailwind, and code Playground
by grc4
HTML
<input type="text" tabindex="3" />
<table>
<tr>
<td><input type="text" /></td>
<td><input type="text" /></td>
<td><input type="text" /></td>
</tr>
<tr>
<td><input type="text" /></td>
<td><input type="text" /></td>
<td><input type="text" /></td>
</tr>
<tr>
<td><input type="text" /></td>
<td><input type="text" /></td>
<td><input type="text" /></td>
</tr>
</table>
CSS
td {
padding: 5px;
}
JavaScript
$(function() {
tabOffset = 10;
$('tr').each(function() {
$(this).find('td').each(function(i) {
$(this).find('input').attr('tabindex', tabOffset + i+1);
});
});
});