fix table layout bugs