diff --git a/public/index.html b/public/index.html
index 763213b..dd2870c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -20,7 +20,7 @@
Manual testing of table sort js
dates in dd/mm/yyyy |
-
+
Franklin |
Benjamin |
1706/1/17 |
@@ -30,7 +30,7 @@ Manual testing of table sort js
10b |
17/6/1978 |
-
+
da Vinci |
Zarlo |
1452/4/15 |
diff --git a/public/table-sort.js b/public/table-sort.js
index 79bf2c6..e8b2496 100644
--- a/public/table-sort.js
+++ b/public/table-sort.js
@@ -141,7 +141,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
const dataAttributeTd = tr.querySelectorAll("td").item(columnIndex)
.dataset.sort;
columnData.push(`${dataAttributeTd}#${i}`);
- columnIndexAndTableRow[columnData[i]] = tr.innerHTML;
+ columnIndexAndTableRow[columnData[i]] = tr.outerHTML;
}
}
@@ -206,7 +206,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
timeinSeconds = hours + minutesInSeconds + seconds;
}
columnData.push(`${timeinSeconds}#${i}`);
- columnIndexAndTableRow[columnData[i]] = tr.innerHTML;
+ columnIndexAndTableRow[columnData[i]] = tr.outerHTML;
}
} catch (e) {
console.log(e);
@@ -244,7 +244,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
);
}
columnData.push(`${numberToSort}#${i}`);
- columnIndexAndTableRow[columnData[i]] = tr.innerHTML;
+ columnIndexAndTableRow[columnData[i]] = tr.outerHTML;
}
} catch (e) {
console.log(e);
@@ -302,7 +302,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}
if (tdTextContent.trim() !== "") {
if (isFileSize) {
- fileSizeColumnTextAndRow[columnData[i]] = tr.innerHTML;
+ fileSizeColumnTextAndRow[columnData[i]] = tr.outerHTML;
}
// These classes already handle pushing to column and setting the tr html.
if (
@@ -314,12 +314,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
!isSortDateMonthDayYear
) {
columnData.push(`${tdTextContent}#${i}`);
- columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.innerHTML;
+ columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.outerHTML;
}
} else {
// Fill in blank table cells dict key with filler value.
columnData.push(`${fillValue}#${i}`);
- columnIndexAndTableRow[`${fillValue}#${i}`] = tr.innerHTML;
+ columnIndexAndTableRow[`${fillValue}#${i}`] = tr.outerHTML;
}
}
@@ -386,6 +386,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
}
}
+
function updateTable(tableProperties) {
const { tableRows, columnData, isFileSize } = tableProperties;
for (let [i, tr] of tableRows.entries()) {
@@ -423,7 +424,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) {
tr.querySelectorAll("td").item(columnIndex).innerHTML =
fileSizeInBytesHTML;
} else if (!isFileSize) {
- tr.innerHTML = columnIndexAndTableRow[columnData[i]];
+ tr.outerHTML = columnIndexAndTableRow[columnData[i]];
}
}
}