diff --git a/src/main/resources/static/js/merge.js b/src/main/resources/static/js/merge.js
index 41d1fe1e..2c9a3939 100644
--- a/src/main/resources/static/js/merge.js
+++ b/src/main/resources/static/js/merge.js
@@ -21,27 +21,55 @@ async function displayFiles(files) {
for (let i = 0; i < files.length; i++) {
const pageCount = await getPDFPageCount(files[i]);
const pageLabel = pageCount === 1 ? pageTranslation : pagesTranslation;
+
+ // Create list item
const item = document.createElement("li");
item.className = "list-group-item";
- item.innerHTML = `
-
-
${files[i].name}
-
- ${pageCount} ${pageLabel}
-
-
-
-
-
-
-
- `;
+
+ // Create filename div and set textContent to sanitize
+ const fileNameDiv = document.createElement("div");
+ fileNameDiv.className = "filename";
+ fileNameDiv.textContent = files[i].name;
+
+ // Create page info div and set textContent to sanitize
+ const pageInfoDiv = document.createElement("div");
+ pageInfoDiv.className = "page-info";
+ const pageCountSpan = document.createElement("span");
+ pageCountSpan.className = "page-count";
+ pageCountSpan.textContent = `${pageCount} ${pageLabel}`;
+ pageInfoDiv.appendChild(pageCountSpan);
+
+ // Create arrows div with buttons
+ const arrowsDiv = document.createElement("div");
+ arrowsDiv.className = "arrows d-flex";
+
+ const moveUpButton = document.createElement("button");
+ moveUpButton.className = "btn btn-secondary move-up";
+ moveUpButton.innerHTML = "