protected function displayBody()
    {
        $count = 0;

        // this uses read-ahead iteration

        $this->model->rewind();
        $row = $this->model->valid() ? $this->model->current() : null;

        $this->model->next();
        $next_row = $this->model->valid() ? $this->model->current() : null;

        if (count($this->model) > 0) {
            echo '<tbody>';

            while ($row !== null) {
                $count++;

                $this->displayRow($row, $next_row, $count);

                $row = $next_row;
                $this->model->next();
                $next_row = $this->model->valid()
                    ? $this->model->current()
                    : null;
            }

            echo '</tbody>';
        } else {
            // to validate in the case where the form has a tfoot but no rows
            echo '<tbody class="swat-hidden"><tr><td></td></tr></tbody>';
        }
    }