Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a table from md-list and md-list-item?

I don't want to use angular-material-data-table for this, since it is a different library.

The following does not work:

<md-list>
  <md-list-item class="md-2-line" ng-repeat="item in todos">
     <div class="md-list-item-text" layout="row">
       <div layout="column">{{item.title}}</div>
       <div layout="column">{{item.description}}</p=div>
     </div>
  </md-list-item>
</md-list>
like image 614
Carlos Galo Campos Avatar asked Jul 01 '16 06:07

Carlos Galo Campos


1 Answers

You can simply use layout-align attribute with span element to get the desired result.

Here is the code.

<md-list style="background-color:red">
  <md-list-item class="md-2-line">
    <div class="md-list-item-text" layout="row" layout-align="start center">
      <span flex="10">Title</span>
      <span flex="5"></span>
      <span flex="30">Dessciption</span>
    </div>
  </md-list-item>
  <md-list-item class="md-2-line" ng-repeat="item in todos">
    <div class="md-list-item-text" layout="row" layout-align="start center">
      <span flex="10">{{item.title}}</span>
      <span flex="5"></span>
      <span flex="30">{{item.description}}</span>
    </div>
  </md-list-item>
</md-list>

Working Example. http://codepen.io/next1/pen/oLWpPG

like image 83
nextt1 Avatar answered Oct 31 '22 23:10

nextt1