add white background to table, encapsulate javascript