update table in javascript