aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/datatable/datatable.component.html
blob: 52d50443282b40c2bc4d094380a856de72b8068e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<div *ngIf="data && hasInput">
    <div class="table-responsive" style="height: 34rem; overflow: auto; border-radius: 5px;" class="mh-5">
        <div *ngIf="!loaded" style="background-color: #003459; width: 100%; height: 100%;"
            class="d-flex justify-content-center align-items-center">
            <app-loading></app-loading>
        </div>
        <div *ngIf="loaded">
            <table *ngIf="data.length > 0 && hasHeader && data[0].length > 0" class="table table-bordered table-light">
                <thead>
                    <tr>
                        <th *ngFor="let item of data[0]; let i = index">{{item}}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let row of data | slice:1">
                        <td *ngFor="let col of row">{{col}}</td>
                    </tr>
                </tbody>
            </table>

            <table *ngIf="data.length > 0 && !hasHeader && data[0].length > 0" class="table table-bordered table-light">
                <tbody>
                    <tr *ngFor="let row of data">
                        <td *ngFor="let col of row">{{col}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div id="info" *ngIf="data.length > 0 && data[0].length > 0">
        <br>
        <span *ngIf="hasHeader">{{data.length - 1}} x {{data[0].length}}</span>
        <span *ngIf="!hasHeader">{{data.length}} x {{data[0].length}}</span>
    </div>
</div>