From 8e55fcba537d7f6374591166d6a6f6ed597fe2a7 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 4 Jan 2021 21:12:27 -0500 Subject: [PATCH] garbage styling --- app.js | 7 ++++--- index.html | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 1d13fc4..21608e9 100644 --- a/app.js +++ b/app.js @@ -28,7 +28,7 @@ const createRow = (datum) => { notesInput.value = datum.notes; } - document.querySelector('table').appendChild(newRow); + document.querySelector('tbody').appendChild(newRow); } document.querySelector('#new').addEventListener('click', () => { @@ -36,9 +36,10 @@ document.querySelector('#new').addEventListener('click', () => { }) document.querySelector('#sort').addEventListener('click', () => { - const rows = document.querySelectorAll('tr'); + const rows = document.querySelectorAll('tbody tr'); const data = []; + console.log(rows); for(let row of rows) { const initiative = row.querySelector('input[type="number"]').value; const name = row.querySelector('input[type="text"]').value; @@ -51,7 +52,7 @@ document.querySelector('#sort').addEventListener('click', () => { return datum1.initiative - datum2.initiative; }); - document.querySelector('table').innerHTML = ""; + document.querySelector('tbody').innerHTML = ""; for(let datum of sortedData){ createRow(datum) } diff --git a/index.html b/index.html index 0b81d6a..a717d8b 100644 --- a/index.html +++ b/index.html @@ -3,11 +3,23 @@ + -
- - +

Combat Tracker

+ + + + + + + + + + + + +
initiativenamenotes