/**
   * Creates rows for the inner tables for each field inside this columsn definition
   *
   * @return a List of created AccountingLineTableRows
   */
  protected List<AccountingLineTableRow> createRowsForFields() {
    List<AccountingLineTableRow> rows = new ArrayList<AccountingLineTableRow>();

    int countForThisRow = 0;
    AccountingLineTableRow row = new AccountingLineTableRow();
    for (AccountingLineViewField field : fields) {
      row.addCell(createHeaderCellForField(field));
      row.addCell(createCellForField(field));
      countForThisRow += 1;

      if (countForThisRow == definition.getColumnCount()) {
        rows.add(row);
        countForThisRow = 0;
        row = new AccountingLineTableRow();
      }
    }
    if (countForThisRow > 0) { // oops! we stopped mid-row and now need to fill it out
      while (countForThisRow < definition.getColumnCount()) {
        row.addCell(createPaddingCell());
        countForThisRow += 1;
      }
      rows.add(row);
    }

    return rows;
  }
 /**
  * Returns the name of this element
  *
  * @see org.kuali.kfs.sys.document.web.TableJoining#getName()
  */
 public String getName() {
   return definition.getName();
 }