code: public int numOfTableColumns() {
          Element rows = tableRows();
          if (rows == null) {
              return -1;
          }
          Element thCells = rows.findChild(app.newElement(Locator.TAGNAME, "th"));
          Element tdCells = rows.findChild(app.newElement(Locator.TAGNAME, "td"));
          return thCells.get().matchCount() + tdCells.get().matchCount();
      }
docs: Retrieves the number of columns in the element. If the element isn't
  present or a table, the returned response will be negative one
  
  @return Integer: the number of columns the table has