html - Not able to properly align table in Angular 2 - unwanted white space to the right -
i making table in angular 2. have 4 columns, after last column unwanted white space right. using bootstrap well.
the below given html class
<div class="panel panel-default"> <div class="panel-heading">user information</div> <div class = 'data-table'> <table style="width:60px" class="text-center" header-class="'text-center'" class="table table-bordered" [mfdata]="data" #mf="mfdatatable" [mfrowsonpage]="10"> <thead> <tr> <th style="width: 10%"></th> <th style="width: 10%"> <mfdefaultsorter by="name">name</mfdefaultsorter> </th> <th style="width: 10%"> <mfdefaultsorter by="email">email</mfdefaultsorter> </th> <th style="width: 10%"> <mfdefaultsorter by="age">age</mfdefaultsorter> </th> <th style="width: 10%"> <mfdefaultsorter by="city">city</mfdefaultsorter> </th> </tr> </thead> <tbody> <tr *ngfor="let item of mf.data"> <td> <button class="btn btn-danger" title="remove"> <span class="glyphicon glyphicon-remove"></span> </button> </td> <td>"aj"</td> <td>"aj"</td> <td class="text-right">"aj"</td> <td>"aj"</td> </tr> </tbody> <tfoot> <tr> <td colspan="3"> <mfbootstrappaginator [rowsonpageset]="[5,10,15]"></mfbootstrappaginator> </td> </tr> </tfoot> </table> </div> </div>
please see screenshot of page:
as denoted in screenshot, have marked in yellow white space right , small column space @ bottom. how remove proper table?
you using 60px width , 10% on each <th>
try change 100% width , 20% on each cell.
<div class="panel panel-default"> <div class="panel-heading">user information</div> <div class = 'data-table'> <table style="width:100%" class="text-center" header-class="'text-center'" class="table table-bordered" [mfdata]="data" #mf="mfdatatable" [mfrowsonpage]="10"> <thead> <tr> <th style="width: 20%"></th> <th style="width: 20%"> <mfdefaultsorter by="name">name</mfdefaultsorter> </th> <th style="width: 20%"> <mfdefaultsorter by="email">email</mfdefaultsorter> </th> <th style="width: 20%"> <mfdefaultsorter by="age">age</mfdefaultsorter> </th> <th style="width: 20%"> <mfdefaultsorter by="city">city</mfdefaultsorter> </th> </tr> </thead> <tfoot> <tr> <td colspan="3"> <mfbootstrappaginator [rowsonpageset]="[5,10,15]"></mfbootstrappaginator> </td> </tr> </tfoot> <tbody> <tr *ngfor="let item of mf.data"> <td> <button class="btn btn-danger" title="remove"> <span class="glyphicon glyphicon-remove"></span> </button> </td> <td>"aj"</td> <td>"aj"</td> <td class="text-right">"aj"</td> <td>"aj"</td> </tr> </tbody> </table> </div> </div>
Comments
Post a Comment