Skip to content

Commit 7de6a39

Browse files
committed
added TO DO list
1 parent e548de9 commit 7de6a39

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

09. TO-DO List/script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ addBtn.addEventListener('click', (e) => {
3434
function addTaskToTable(task) {
3535
const node = document.createElement("tr");
3636
node.innerHTML = `
37-
<td class="task_name">${task.name}</td>
37+
<td class="task_name"><p>${task.name}</p></td>
3838
<td class="task_due_date">${task.date}</td>
3939
<td class="task_status">${task.status}</td>
4040
<td class="task_actions">
@@ -45,6 +45,9 @@ function addTaskToTable(task) {
4545

4646
tableBody.appendChild(node);
4747

48+
// Automatically scroll to the latest task
49+
node.scrollIntoView({behavior: 'smooth', block: 'end'});
50+
4851
// Add event listeners for the new task's actions
4952
node.querySelector('.complete-task').addEventListener('click', () => {
5053
task.status = 'Completed';
@@ -89,7 +92,6 @@ function removeTaskFromLocalStorage(taskToRemove) {
8992
localStorage.setItem('tasks', JSON.stringify(tasks));
9093
}
9194

92-
9395
window.addEventListener('load', () => {
9496
loader.style.display = 'none';
95-
});
97+
});

09. TO-DO List/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ td {
169169
white-space: nowrap;
170170
}
171171

172+
td p {
173+
white-space: nowrap;
174+
overflow: hidden;
175+
text-overflow: ellipsis;
176+
max-width: 150px;
177+
}
178+
172179
thead {
173180
background-color: var(--primary-color);
174181
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ developer, or just curious, your feedback and insights are always welcome.
1919
| 06 | [Password Generator Application](https://github.com/RanitManik/JavaScript-Projects/tree/main/06.%20Password%20Generator%20Application) | [Live Demo](https://ranitmanik.github.io/JavaScript-Projects/06.%20Password%20Generator%20Application/index.html) |
2020
| 07 | [Cash Calculator Application](https://github.com/RanitManik/JavaScript-Projects/tree/main/07.%20Cash%20Calculator%20Application) | [Live Demo](https://ranitmanik.github.io/JavaScript-Projects/07.%20Cash%20Calculator%20Application/index.html) |
2121
| 08 | [HEX Code Generator](https://github.com/RanitManik/JavaScript-projects/tree/main/08.%20HEX%20Code%20Generator) | [Live Demo](https://ranitmanik.github.io/JavaScript-Projects/08.%20HEX%20Code%20Generator/index.html) |
22-
| 09 | [09. TO-DO List](https://github.com/RanitManik/JavaScript-projects/tree/main/09.%20TO-DO%20List) | [Live Demo](https://ranitmanik.github.io/JavaScript-Projects/09.%20TO-DO%20List/index.html) |
22+
| 09 | [TO-DO List](https://github.com/RanitManik/JavaScript-projects/tree/main/09.%20TO-DO%20List) | [Live Demo](https://ranitmanik.github.io/JavaScript-Projects/09.%20TO-DO%20List/index.html) |
2323

2424
## How to Use
2525

0 commit comments

Comments
 (0)