primereact icon indicating copy to clipboard operation
primereact copied to clipboard

DataTable: CSS Bug with attributes 'showGridLines' and 'scrollable'

Open paulBrdInfotel opened this issue 1 year ago • 11 comments

Describe the bug

Firstaly, If you use a DataTable with the showGridLines and scrollable attributes, when you scroll the DataTable you can see the data in the top row because the header has no longer a border.

image

Then, I couldn't find an attribute to have a border at the bottom of the DataTable. Because if my table doesn't show all line and i have a scroll bar.

NO OK : image

OK : image

Reproducer

No response

PrimeReact version

10.7.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Edge

Steps to reproduce the behavior

No response

Expected behavior

No response

paulBrdInfotel avatar Jul 09 '24 15:07 paulBrdInfotel

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

github-actions[bot] avatar Jul 11 '24 11:07 github-actions[bot]

I tried to create the bug on Stackblitz but I can't do it. But i found the cause, I use PrimeReact with Tailwind Css and the layer of Tailwind has priority over PrimeReact layer. I do the same configuration like the documentation.

image

Tailwind css add the attribut 'border-collapse: collapse' in table :

image

paulBrdInfotel avatar Jul 11 '24 14:07 paulBrdInfotel

Are you using Tailwind only or also a PF theme?

melloware avatar Jul 11 '24 15:07 melloware

If you mean PrimeReact theme, I use lara light blue theme :

image

paulBrdInfotel avatar Jul 12 '24 08:07 paulBrdInfotel

@paulBrdInfotel try this I can't reproduce: pr-6857.zip

Unzip it and run npm install then npm run dev and go to http://localhost:3000/ it looks fine for me with Tailwind and Lara Light Blue.

melloware avatar Jul 12 '24 12:07 melloware

I've run your code and I'm having the same problem. You can see it on the screenshot. I've tried it on Edge and Chrome (I've put their version on) but I might try it on Firefox next Tuesday.

image image

image image

paulBrdInfotel avatar Jul 12 '24 13:07 paulBrdInfotel

totally fine for me in latest Chrome and Firefox:

image

image

melloware avatar Jul 12 '24 13:07 melloware

Have you tried scrolling down? Because in your screenshot, the scroll bar is at the top.

paulBrdInfotel avatar Jul 12 '24 14:07 paulBrdInfotel

i see yeah it looks like the header is off one pixel.

I am sure you can look at the CSS in the inspector and figure out what TailWind or PR style is affecting it.

melloware avatar Jul 12 '24 14:07 melloware

I'm going to try and solve this problem, but I imagine that other people will have the same bug.

It would be a pity not to fix this bug for future users.

Thanks for your help.

paulBrdInfotel avatar Jul 12 '24 14:07 paulBrdInfotel

Yep it looks like its juts slightly off so i am sure its a CSS change somewhere in here.

melloware avatar Jul 12 '24 15:07 melloware