0

I have a Bootstrap Vue table with a pagination component underneath it. I've currently got it in a separate row in a single column but whilst it looks "fairly" centred, it's actually not centred in the column and there is uneven padding/margin on the right side. Looking like it's from the tag (per image).

enter image description here

How can I horizontally centre the pagination pls?

</b-table>

<b-row align-h="center" align-content="center">
  <b-col cols="3">

    <b-pagination
      v-model="currentPage"
      :total-rows="totalRows"
      :per-page="perPage"
      aria-controls="my-table"
      
    ></b-pagination>

  </b-col>
</b-row>
3
  • 1
    try adding justify-content: center; to your .pagination class Commented Jan 31, 2022 at 15:34
  • That worked! Thank you - can you put it as an answer and I will mark as correct for you! Cheers :-) Commented Jan 31, 2022 at 16:06
  • Done ! thanks Johnny John Boy Commented Jan 31, 2022 at 16:11

2 Answers 2

1

You could use cols="auto" instead of cols="3", that way the column will automatically size itself after the content, instead a specific width as you have now.

https://bootstrap-vue.org/docs/components/layout#variable-width-content

<b-row align-h="center" align-content="center">
  <b-col cols="auto">
    <b-pagination></b-pagination>
  </b-col>
</b-row>

You could also use Bootstraps Flex Utilities

<div class="d-flex justify-content-center">
  <b-pagination></b-pagination>
</div>
Sign up to request clarification or add additional context in comments.

Comments

1

try adding justify-content: center; to your .pagination class

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.