0

我有一个 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%宽度

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

4

1 回答 1

0

CSS:

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

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

.mat-paginator-outer-container {
  justify-content: center !important;
}
于 2021-12-09T11:52:34.873 回答