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

Component Name: Datatable column header style or class does not work with text right alignment #6947

Open
timothymarois opened this issue Dec 10, 2024 · 1 comment
Labels
Resolution: Cannot Replicate Issue could not be replicated by Core Team

Comments

@timothymarois
Copy link

Describe the bug

There seems to be no way to get the header to have a right alignment. If you try flex justify-end It messes up the alignment of the entire column from the rest of the table. If you use text-right or text-align:right these only get applied to the body cell but the header cell can not be adjusted.

Unable to text align the header cell to the right. No matter the CSS used in the presets or props.

Screenshot 2024-12-10 at 5 12 03 PM

Using a hack like flex justify-end, but messes up the rest of the table.

Screenshot 2024-12-10 at 5 11 48 PM

Trying to align using column props are no luck.

                    <Column
                            field="added"
                            header="Added"
                            header-style="width: 285px;text-align:right;"
                            class="text-right"
                        >
                            <template #body="slotProps">
                                <div class="text-right">0</div>
                            </template>
                        </Column>

Reason why you cant do it, because over the inner div class flex items-center which I understand based on the sorting. But if you don't have sorting, you should not have these classes.

While inside presets its called

columnHeaderContent: {
            class: 'flex items-center'
        },

But doesn't seem to allow for customization, so you either need it for other columns or you don't. This doesn't appear to be customizable by the column itself.

Reproducer

https://github.com/cagataycivici/primevue-tailwindcss-presets/blob/main/presets/lara/datatable/index.js

PrimeVue version

4.2.4

Vue version

4.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@timothymarois timothymarois added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 10, 2024
@tugcekucukoglu tugcekucukoglu added Resolution: Cannot Replicate Issue could not be replicated by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 11, 2024
Copy link

We're unable to replicate your issue, if you are able to create a reproducer by using PrimeVue Issue Template or add details please edit this issue. This issue will be closed if no activities in 20 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Cannot Replicate Issue could not be replicated by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants