Adapted column length
This commit is contained in:
parent
f9a6255bc8
commit
9313568e0d
@ -26,15 +26,18 @@ function renderTable() {
|
|||||||
data.players.forEach((name, i) => {
|
data.players.forEach((name, i) => {
|
||||||
const th = document.createElement('th');
|
const th = document.createElement('th');
|
||||||
th.innerText = name;
|
th.innerText = name;
|
||||||
|
th.classList.add('name-col');
|
||||||
headRow.appendChild(th);
|
headRow.appendChild(th);
|
||||||
});
|
});
|
||||||
// Guest column
|
// Guest column
|
||||||
const guestTh = document.createElement('th');
|
const guestTh = document.createElement('th');
|
||||||
guestTh.innerText = data.guest || 'Guest';
|
guestTh.innerText = data.guest || 'Guest';
|
||||||
|
guestTh.classList.add('name-col');
|
||||||
headRow.appendChild(guestTh);
|
headRow.appendChild(guestTh);
|
||||||
// Guest Name column (per date)
|
// Guest Name column (per date)
|
||||||
const guestNameTh = document.createElement('th');
|
const guestNameTh = document.createElement('th');
|
||||||
guestNameTh.innerText = 'Guest Name';
|
guestNameTh.innerText = 'Guest Name';
|
||||||
|
guestNameTh.classList.add('name-col');
|
||||||
headRow.appendChild(guestNameTh);
|
headRow.appendChild(guestNameTh);
|
||||||
thead.appendChild(headRow);
|
thead.appendChild(headRow);
|
||||||
table.appendChild(thead);
|
table.appendChild(thead);
|
||||||
@ -50,7 +53,7 @@ function renderTable() {
|
|||||||
// Player attendance
|
// Player attendance
|
||||||
[...data.players, data.guest].forEach((player, colIdx) => {
|
[...data.players, data.guest].forEach((player, colIdx) => {
|
||||||
const td = document.createElement('td');
|
const td = document.createElement('td');
|
||||||
td.className = 'clickable';
|
td.className = 'clickable name-col';
|
||||||
const key = `${date}|${colIdx}`;
|
const key = `${date}|${colIdx}`;
|
||||||
if (data.attendance[key]) {
|
if (data.attendance[key]) {
|
||||||
td.innerText = 'Yes';
|
td.innerText = 'Yes';
|
||||||
@ -71,6 +74,7 @@ function renderTable() {
|
|||||||
});
|
});
|
||||||
// Guest Name column (input per date)
|
// Guest Name column (input per date)
|
||||||
const guestNameTd = document.createElement('td');
|
const guestNameTd = document.createElement('td');
|
||||||
|
guestNameTd.classList.add('name-col');
|
||||||
const guestNameInput = document.createElement('input');
|
const guestNameInput = document.createElement('input');
|
||||||
guestNameInput.type = 'text';
|
guestNameInput.type = 'text';
|
||||||
guestNameInput.value = data.guestNames[date] || '';
|
guestNameInput.value = data.guestNames[date] || '';
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
.yes { background: #b6e7b6; font-weight: bold; }
|
.yes { background: #b6e7b6; font-weight: bold; }
|
||||||
input[type="text"] { width: 90%; }
|
input[type="text"] { width: 90%; }
|
||||||
#add-date { margin-top: 1em; }
|
#add-date { margin-top: 1em; }
|
||||||
|
.name-col { width: 140px; min-width: 140px; max-width: 140px; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user