public function getXhtmlColspan()
    {
        $colspan = 0;

        // Add all colspans of visible columns to get table colspan.
        foreach ($this->getVisibleColumns() as $column) {
            $colspan += $column->getXhtmlColspan();
        }

        // Check each spanning column. If it has more colspan than the colspan
        // defined by the columns, set the table colspan to the spanning column
        // colspan.
        foreach ($this->getVisibleSpanningColumns() as $column) {
            $spanning_colspan = $column->getXhtmlColspan();
            if ($spanning_colspan > $colspan) {
                $colspan = $spanning_colspan;
            }
        }

        return $colspan;
    }