added table headers

This commit is contained in:
Ell 2022-09-27 21:29:50 +02:00
parent 09d9bc4132
commit b972ab3def
5 changed files with 13 additions and 4 deletions

View file

@ -64,6 +64,12 @@ export function displayTracker(tracker: Tracker, element: HTMLElement): void {
// add list
let table = element.createEl("table", { cls: "simple-time-tracker-table" });
table.createEl("tr").append(
createEl("th", { text: "Segment" }),
createEl("th", { text: "Start Time" }),
createEl("th", { text: "End Time" }),
createEl("th", { text: "Total" }));
for (let entry of tracker.entries) {
let row = table.createEl("tr");
row.createEl("td", { text: entry.name });

View file

@ -48,6 +48,7 @@
margin-top: 20px;
}
.simple-time-tracker-table td {
.simple-time-tracker-table td,
.simple-time-tracker-table th {
border: none;
}

File diff suppressed because one or more lines are too long

View file

@ -48,6 +48,7 @@
margin-top: 20px;
}
.simple-time-tracker-table td {
.simple-time-tracker-table td,
.simple-time-tracker-table th {
border: none;
}

View file

@ -1,7 +1,7 @@
This is a time tracker:
```simple-time-tracker
{"entries":[{"name":"Segment 1","startTime":1664306406,"endTime":1664306408},{"name":"Segment 2","startTime":1664306409,"endTime":1664306410},{"name":"Segment 3","startTime":1664306411,"endTime":1664306412},{"name":"Segment 4","startTime":1664306413,"endTime":1664306422},{"name":"Segment 5","startTime":1664306455,"endTime":1664306458},{"name":"Segment 6","startTime":1664306543,"endTime":1664306545},{"name":"Segment 7","startTime":1664306581,"endTime":1664306599}]}
{"entries":[{"name":"Segment 1","startTime":1664306406,"endTime":1664306408},{"name":"Segment 2","startTime":1664306409,"endTime":1664306410},{"name":"Segment 3","startTime":1664306411,"endTime":1664306412},{"name":"Segment 4","startTime":1664306413,"endTime":1664306422},{"name":"Segment 5","startTime":1664306455,"endTime":1664306458},{"name":"Segment 6","startTime":1664306543,"endTime":1664306545},{"name":"Segment 7","startTime":1664306581,"endTime":1664306599},{"name":"Segment 8","startTime":1664306956,"endTime":1664306959},{"name":"Segment 9","startTime":1664306962,"endTime":1664306965}]}
```