2

I'm using datatable component from primereact. I have a double borders problem with a scrollable talbe.

Here is the sandbox example : https://codesandbox.io/s/primereact-demo-forked-emfgtk?file=/src/App.js

As you can see in browser part, bottom border in header are thicker.

I would like to have simple borders

2
  • On Chrome, no ticker borders are shown. Have you tried other browsers? Commented May 5, 2023 at 9:33
  • There is, also on chrome. Commented May 5, 2023 at 9:38

1 Answer 1

1

The problem is, that you have a border-bottom and border-top, basically doubling the border width.

The cleanest solution would be to add border-collapse: collapse to the table itself. You can read more about it here.

One solution is to add the following style:

.p-datatable.p-datatable-gridlines .p-datatable-thead > tr:not(:first-of-type) > th {
    border-top: 0;
}

Which basically removes the top-border on all Table-Headers which are not in the first row.

Sign up to request clarification or add additional context in comments.

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.