Adding cells to a table
There a few options here, for instance you don't need to use Jquery as much as you are using. This will optimize greatly all of your code.
You can simply use JavaScript commands related to table with document.getElementById("table").rows[].cell[]
 which is very simple and works very nicely and fast. By doing that there  is no need to assign ID's to everything on the table, as you probably are doing now.