Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table Header Alignment #356

Closed
ismet opened this issue Oct 6, 2017 · 2 comments
Closed

Table Header Alignment #356

ismet opened this issue Oct 6, 2017 · 2 comments
Assignees

Comments

@ismet
Copy link

ismet commented Oct 6, 2017

I want to make a specific column text (header + data) to align center.

I added class="has-text-centered" or style="text-align:center" to the <b-table-column>. This makes only data centered, not header.

How can I change the alignment of <b-table> header?

Note: The header scoped slot change all column headers, not one of them..

@jtommy
Copy link
Member

jtommy commented Oct 9, 2017

@ismet Header slot allow to read all bColumn properties and it is applied to each header column.
In your case you might have something like to apply a custom style only for one column:

<template scope="props" slot="header">
   <div style="width: 100%" :class="{'has-text-centered': props.column.label === 'FN'}">
     {{ props.column.label }}
   </div>
</template>

@ismet
Copy link
Author

ismet commented Oct 10, 2017

@jtommy, :class property works however the header text is not aligned properly if has-text-centered or has-text-centered is applied.

has-text-right
image

has-text-centered
image

As you can see, there is an interesting and unnecessary space at the right of the header cell.

@jtommy jtommy self-assigned this Oct 10, 2017
@jtommy jtommy closed this as completed in 7640ed4 Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants