Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set different width for md-grid-tile

I use new Angular Material. This code produce grid with two columns:

<md-grid-list cols="2" rowHeight="10">
  <md-grid-tile></md-grid-tile>
  <md-grid-tile></md-grid-tile>
</md-grid-list>

How to set 20% width to first columns and remaning 80% to second?

like image 294
Daniel Avatar asked Aug 10 '17 06:08

Daniel


People also ask

How do you adjust the width of a mat grid tile?

Make sure that the sum of col span is equal to cols Size. Show activity on this post. @Venetian Village.. you can devide the width of browser with the row class of CSS. Here height :100vh is taking complete the browser window height or if you want use parent's div use height: 100% .

What is rowHeight in mat grid list?

The height of the rows in a grid list can be set via the rowHeight attribute. Row height for the list can be calculated in three ways: Fixed height: The height can be in px , em , or rem . If no units are specified, px units are assumed (e.g. 100px , 5em , 250 ).

What is angular grid?

The Angular Data Grid component is a feature-rich control for displaying data in a tabular format. Its wide range of functionalities includes data binding, editing, Excel-like filtering, custom sorting, grouping, row reordering, freezing rows and columns, aggregating rows, and exporting to Excel, CSV, and PDF formats.


1 Answers

Try this:

<md-grid-list cols="10" rowHeight="2:1">
  <md-grid-tile colspan='2'>1</md-grid-tile>
  <md-grid-tile colspan='8'>2</md-grid-tile>
</md-grid-list>

you need to read this documentation: https://material.angular.io/components/grid-list/overview

enter image description here

like image 149
Raed Khalaf Avatar answered Oct 21 '22 18:10

Raed Khalaf