diff --git a/src/ExtendedTableWidget.cpp b/src/ExtendedTableWidget.cpp index 8f75f2ad..d23523f9 100644 --- a/src/ExtendedTableWidget.cpp +++ b/src/ExtendedTableWidget.cpp @@ -227,7 +227,7 @@ void ExtendedTableWidget::copy(const bool withHeaders) QString result; QString htmlResult = "
"; - int currentRow = 0; + int currentRow = indices.first().row(); const QString fieldSepHtml = "
"; const QString rowSepHtml = "
"; @@ -252,10 +252,11 @@ void ExtendedTableWidget::copy(const bool withHeaders) } // Table data rows - htmlResult.append("
"); for(const QModelIndex& index : indices) { - // Separators - if (index.row() != currentRow) { + // Separators. For first cell, only opening table row tags must be added for the HTML and nothing for the text version. + if (indices.first() == index) + htmlResult.append("
"); + else if (index.row() != currentRow) { result.append(rowSepText); htmlResult.append(rowSepHtml); } else {