繁体   English   中英

中心 ngx 分页

[英]Center ngx-pagination

我有一个 ngx 分页:

<pagination-controls
                  id="pagination"
                  (pageChange)="page = $event"
                  (pageBoundsCorrection)="page = $event"
                  [maxSize]="9"
                  [directionLinks]="true"
                  [autoHide]="true"
                  [responsive]="true"
                  previousLabel="Previous"
                  nextLabel="Next"
                  screenReaderPaginationLabel="Pagination"
                  screenReaderPageLabel="page"
                  screenReaderCurrentLabel="You're on page">
</pagination-controls>

中心的东西像:

<div class="d-flex justify-content-center">
  <my-pagination></my-pagination>
</div>

不起作用,因为分页的宽度总是页面的 100%宽度

我怎样才能使分页的宽度尽可能小并保持负责?

CSS:

.mat-paginator-container {
  width: fit-content !important;
}

如果你想在任何地方居中添加这个:

.mat-paginator-outer-container {
  justify-content: center !important;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM