Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center ngb-pagination in angular4?

<div class="col-12 text-center">
  <ngb-pagination [collectionSize]="120" [(page)]="pageNumber" 
   [maxSize]="5" [rotate]="true" [boundaryLinks]="true" size="lg">
  </ngb-pagination>
</div>

I am using ng-bootstrap and angular 4 for my project, the above code does not center pagination component. Is there a way to center it ? Thanks for helping.

like image 354
Hang Chen Avatar asked Dec 07 '22 16:12

Hang Chen


1 Answers

Try like this :

template.html

<div class="col-12 justify-content-center">
  <ngb-pagination [collectionSize]="120" [(page)]="pageNumber" 
   [maxSize]="5" [rotate]="true" [boundaryLinks]="true" size="lg">
  </ngb-pagination>
</div>

style.css

.justify-content-center {
    display: flex !important;
    justify-content: center !important;
}
like image 119
Chandru Avatar answered Dec 10 '22 11:12

Chandru