Daniel
Daniel

Reputation: 1755

How to diplay md-grid-tile in first column?

I have md-grid that builds table:

<div *ngFor="let replacement of getReplcaementRows()">
   <md-grid-tile rowspan="5" colspan="1" class="md-grid-body"></md-grid-tile>
</div>

So, how to change content only for cells in first column by vertically?

I mean this:

**1** 2 3 
**4** 5 6
**6** 7 8

Upvotes: 0

Views: 73

Answers (1)

Nehal
Nehal

Reputation: 13297

You can use the index from *ngFor to find out the first item in each row and add some *ngIf statements to control the view.

Example (using your example):

<md-grid-list rowspan="5" colspan="1" cols="3">
   <md-grid-tile  class="md-grid-body" 
                  *ngFor="let replacement of getReplcaementRows(); let i = index">
     <span *ngIf="i%3 == 0">**{{replacement}}**</span>
     <span *ngIf="i%3 != 0">{{replacement}}</span>
   </md-grid-tile>
</md-grid-list>

Plunker demo

First column content modification demo

Upvotes: 1

Related Questions