JavaScript functions to place a rectangle at the same location as a table cell