Change bikes table
parent
db0863404d
commit
892e5dc224
@ -1,37 +1,46 @@
|
|||||||
<button mat-raised-button color="primary">Primary</button>
|
<div class="table-control">
|
||||||
<button mat-raised-button color="accent">Accent</button>
|
<button mat-raised-button color="primary">Primary</button>
|
||||||
|
<button mat-raised-button color="accent">Accent</button>
|
||||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
|
</div>
|
||||||
|
<table mat-table [dataSource]="bikes" class="mat-elevation-z8">
|
||||||
<!--- Note that these columns can be defined in any order.
|
<!--- Note that these columns can be defined in any order.
|
||||||
The actual rendered columns are set as a property on the row definition" -->
|
The actual rendered columns are set as a property on the row definition" -->
|
||||||
|
|
||||||
<!-- Position Column -->
|
<!-- Position Column -->
|
||||||
<ng-container matColumnDef="position">
|
<ng-container matColumnDef="id">
|
||||||
<th mat-header-cell *matHeaderCellDef> No. </th>
|
<th mat-header-cell *matHeaderCellDef>ID</th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
|
<td mat-cell *matCellDef="let element">{{ element.id }}</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Name Column -->
|
<!-- Name Column -->
|
||||||
<ng-container matColumnDef="name">
|
<ng-container matColumnDef="name">
|
||||||
<th mat-header-cell *matHeaderCellDef> Name </th>
|
<th mat-header-cell *matHeaderCellDef>Name</th>
|
||||||
<td mat-cell *matCellDef="let element" contenteditable (input)="onTableInput(element)"> {{element.name}} </td>
|
<td
|
||||||
|
mat-cell
|
||||||
|
*matCellDef="let element"
|
||||||
|
contenteditable
|
||||||
|
(input)="onTableInput(element)"
|
||||||
|
>
|
||||||
|
{{ element.name }}
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Weight Column -->
|
<!-- Weight Column -->
|
||||||
<ng-container matColumnDef="weight">
|
<ng-container matColumnDef="weight">
|
||||||
<th mat-header-cell *matHeaderCellDef> Weight </th>
|
<th mat-header-cell *matHeaderCellDef>Weight</th>
|
||||||
<td mat-cell *matCellDef="let element">
|
<td mat-cell *matCellDef="let element">
|
||||||
<mat-form-field><input matInput color="warn" [value]="element.weight"></mat-form-field>
|
<mat-form-field
|
||||||
|
><input matInput color="warn" [value]="element.weight"
|
||||||
|
/></mat-form-field>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<!-- Symbol Column -->
|
<!-- Symbol Column -->
|
||||||
<ng-container matColumnDef="symbol">
|
<ng-container matColumnDef="symbol">
|
||||||
<th mat-header-cell *matHeaderCellDef> Symbol </th>
|
<th mat-header-cell *matHeaderCellDef>Symbol</th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
|
<td mat-cell *matCellDef="let element">{{ element.symbol }}</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
.table-control {
|
||||||
|
margin: 0.5em;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
Loading…
Reference in New Issue