partial implementation of table-related javascript