This method was taken from table.js. I will drop it and put it back.