Vertical Tab Inputs

by Raul Bojalil

HTML

<table>
  <tr>
    <td><input type="text"/></td>
   <td><input type="text"/></td>
  </tr>
  <tr>
    <td><input type="text"/></td>
    <td><input type="text"/></td>
  </tr>
  <tr>
    <td><input type="text"/></td>
    <td><input type="text"/></td>
  </tr>
</table>

JavaScript

var index=1;
var colIndex=0;
var colCount = $("table tr:first td").length;

while(colIndex < colCount)
{
    $("tr").each(function(){
    	$($(this).find("input")[colIndex]).attr("tabindex", index);
    	index++;
  	});
	  colIndex++;
}