/**
  * Adds a row to the table
  *
  * @param XhtmlRow $o_row
  * @param int $i_group_index
  */
 function AddRow(XhtmlRow $o_row, $i_group_index = 0)
 {
     if ($o_row->GetIsHeader()) {
         if (!is_object($this->o_headergroup)) {
             $this->o_headergroup = new XhtmlRowGroup(true);
         }
         $this->o_headergroup->AddControl($o_row);
     } else {
         if ($o_row->GetIsFooter()) {
             if (!is_object($this->o_footergroup)) {
                 $this->o_footergroup = new XhtmlRowGroup();
                 $this->o_footergroup->SetIsFooter(true);
             }
             $this->o_footergroup->AddControl($o_row);
         } else {
             if (isset($this->a_rowgroups[$i_group_index])) {
                 $this->a_rowgroups[$i_group_index]->AddControl($o_row);
                 $this->i_rowcount++;
             }
         }
     }
 }