1 Commits
v2.2 ... v2.2.1

Author SHA1 Message Date
eneller
29633a94c0 feat: better table formatting 2025-03-12 22:57:53 +01:00
3 changed files with 15 additions and 9 deletions

View File

@@ -1,8 +1,3 @@
<style>
*{
text-align: center;
}
</style>
<main class="main">
<div class="row justify-content-md-center">
<h1>Please select the number of teams:</h1>
@@ -40,7 +35,7 @@
<button type="button" (click)="onButtonGenerate(playerNames.value)" class="btn btn-primary">Generate</button>
</form>
<table class="table table-striped">
<table class="table table-striped custom-table">
<thead>
<tr>
<th scope="col">Size</th>
@@ -50,8 +45,8 @@
<tbody>
@for (team of teamsArray; track $index) {
<tr>
<td>{{ team.length | number }}</td>
<td>{{ team }}</td>
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
<td class="wrap-cell">{{ team }}</td>
</tr>
}
</tbody>

View File

@@ -0,0 +1,11 @@
*{
text-align: center;
}
.custom-table {
//table-layout: fixed;
width: 100%; /* Or a specific max-width */
}
.wrap-cell{
word-break: break-word;
white-space: normal;
}

View File

@@ -23,7 +23,7 @@ export class AppComponent implements OnInit {
constructor(private activatedRoute: ActivatedRoute){}
ngOnInit(): void {
//consiedr using Angular's ActivatedRoute here instead
//TODO consider using Angular's ActivatedRoute here instead
const params = new URLSearchParams(window.location.search);
const names = params.get('names')?.replaceAll(',', '\n');
if (names) this.playerNamesValue = names;