JavaScript: Table-update