Updated tables.js to reflect new PHP code