2016-11-30 5 views
0

私は1D配列(人のリスト)を持っています。私は、角2列に行列形式でこのデータを表示するには、次のようになります。角2:配列を行列形式で表示

[ 
{Id: 1, FirstName: 'Michael', LastName: 'Jackson'}, 
{Id: 2, FirstName: 'Aamir', LastName: 'Khan'}, 
{Id: 3, FirstName: 'Meg', LastName: 'Ryan'}, 
{Id: 4, FirstName: 'Raj', LastName: 'Kumar'}, 
{Id: 5, FirstName: 'Michael', LastName: 'Jordan'}, 
{Id: 6, FirstName: 'Serena', LastName: 'Williams'}, 
{Id: 7, FirstName: 'Rathi', LastName: 'Agnihotri'}, 
] 

出力は次のようにする必要があります:

Michael Jackson     Aamir Khan    Meg Ryan 
Raj Kumar      Michael Jordan   Serena Williams 
Rathi Agnihotri 

私はこれをどのように達成することができますか?

+0

謝罪。 –

+0

https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html、https://angular.io/docs/ts/latest/guide/displaying-dataの質問が更新されました。 HTML SOはコードサルの束ではありません。あなたの質問はあなたの努力を示すべきです。 –

答えて

0

これを達成するためにブートストラップリストインラインスタイルを使用しました。私は自分のメディアクエリーを追加しました。不完全なポスト、ギュンターため

@media screen and (max-width: 400px) { 
 
    .searchedItem { 
 
     width: 94%; 
 
    } 
 
} 
 

 
@media screen and (min-width:401px) and (max-width: 768px) { 
 
    .searchedItem { 
 
     width: 47.5%; 
 
    } 
 
} 
 

 
@media screen and (min-width:769px) and (max-width: 992px) { 
 
    .searchedItem { 
 
     width: 23%; 
 
    } 
 
} 
 

 
@media screen and (min-width:993px) { 
 
    .searchedItem { 
 
     width: 19%; 
 
    } 
 
}

関連する問題