cosh
cosh

Reputation: 480

How to set row spacing in Angular Material's Grid?

I can't seem to find a way to set the spacing between rows for Angular Material's Grid List. I've tried gutter size, but it only crops up my tile content. I can't find a plunker or a fiddler for Angular Material, and I know the question is a little bit too specific, but any help would be greatly appreciated.

Upvotes: 10

Views: 22130

Answers (2)

Samuel Rangira
Samuel Rangira

Reputation: 1

I used the same code to solve the problem, but my first line looked like this:

I basically did not need to use the brackets and extra single quotes.

Upvotes: -1

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24472

You can set row spacing by gutterSize property like this

<mat-grid-list cols="2" rowHeight="2:1" [gutterSize]="'10px'">
  <mat-grid-tile>1</mat-grid-tile>
  <mat-grid-tile>2</mat-grid-tile>
  <mat-grid-tile>3</mat-grid-tile>
  <mat-grid-tile>4</mat-grid-tile>
</mat-grid-list>

stackblitz demo

Upvotes: 27

Related Questions