Commit 3809eee4 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Affichage des numéros de lignes et noms de colonnes dans l'export HTML d'une feuille

parent 174dbf55
Loading
Loading
Loading
Loading
Loading
+8 −7
Changes for src/Calc/Sheet.php: 8 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -92,16 +92,12 @@ class Sheet
    protected function readRow(DOMNode $rowNode, int $row)
    {
        $cells = $rowNode->childNodes;
        $col   = 0;
        $col   = 1;
        foreach ($cells as $c) {
            $col++;
            if ('table:covered-table-cell' == $c->tagName) {
                $col--;
            }
            if ('table:table-cell' == $c->tagName) {
                $cell = new Cell($c);
                if ($r = $cell->getRepeated()){
                    $col += $r - 1;
                    $col += $r;
                    continue;
                }
                $init = true;
@@ -227,8 +223,13 @@ class Sheet
    public function html(): string
    {
        $h = '<table class="table table-bordered table-condensed">';
        $h .= '<tr><th></th>';
        for( $c=1;$c<=$this->getMaxCol();$c++){
            $h .= '<th>'.(Calc::numberToLetter($c)).'</th>';
        }
        $h .= '</tr>';
        for( $r=1;$r<=$this->getMaxRow();$r++){
            $h .= '<tr>';
            $h .= '<tr><th>'.$r.'</th>';
            for( $c=1;$c<=$this->getMaxCol();$c++){
                $cell = $this->getCellByCoords($c,$r);
                $h .= '<td>'.($cell ? $cell->getContent() : '').'</td>';