shadcn ui table

hello, shadcn ui table not responsive on mobile, if anyone ever encounter the same problem please letme know thanks!
No description
21 Replies
JEM
JEM10mo ago
You should be able to go into your components/ui folder and edit the shadcn component to your liking, in this case one of the common ways would be around tablet size add a horizontal scroll
barry
barry10mo ago
I don't think that's shadcn/ui but I think it's just your layout effecting it
arete
arete10mo ago
already remove all the layout, still the same tho
No description
arete
arete10mo ago
any idea?
barry
barry10mo ago
have you tried actually on your phone cuz sometimes dev tools is fucked
arete
arete10mo ago
arete
arete10mo ago
yea i found this when i showing of my webapp to my friend, so embarrasing lel
barry
barry10mo ago
well did you use devtools to see what was there in the white space
arete
arete10mo ago
it just html
barry
barry10mo ago
poohheh aaand i give up, good luck
arete
arete10mo ago
arete
arete10mo ago
thanks tho
JEM
JEM10mo ago
hmmm what does your globals.css look like is tailwind all set up correctly? html should be the full window not smaller like your video
arete
arete10mo ago
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 221.2 83.2% 53.3%;
--radius: 1rem;
}

.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 217.2 91.2% 59.8%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 224.3 76.3% 48%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

@layer utilities {
.step {
counter-increment: step;
}

.step:before {
@apply absolute w-8 h-8 bg-muted rounded-full font-medium text-center text-base inline-flex items-center justify-center -indent-px;
@apply ml-[-41px];
content: counter(step);
}
}

@media (max-width: 640px) {
.container {
@apply px-4;
}
}


@layer base {
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
}


@media screen
{
.noPrint{display:none;}
.noScreen{}
}

@media print
{
.noPrint{}
.noScreen{display:none;}
}

[cmdk-loading]{
@apply py-6 text-center text-sm;
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 221.2 83.2% 53.3%;
--radius: 1rem;
}

.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 217.2 91.2% 59.8%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 224.3 76.3% 48%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

@layer utilities {
.step {
counter-increment: step;
}

.step:before {
@apply absolute w-8 h-8 bg-muted rounded-full font-medium text-center text-base inline-flex items-center justify-center -indent-px;
@apply ml-[-41px];
content: counter(step);
}
}

@media (max-width: 640px) {
.container {
@apply px-4;
}
}


@layer base {
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
}


@media screen
{
.noPrint{display:none;}
.noScreen{}
}

@media print
{
.noPrint{}
.noScreen{display:none;}
}

[cmdk-loading]{
@apply py-6 text-center text-sm;
}
heres the globals.css any thing wrong
JEM
JEM10mo ago
something I noticed is I am not quite sure you can have multiple @layer base {} calls? I am not 100% positive about that but I combined mine personally but that also might be unrelated too
arete
arete10mo ago
i combine the base @layer base but still doin the same thing
JEM
JEM10mo ago
bummer
arete
arete10mo ago
yep
Stward
Stward10mo ago
Just wrap it up in a div with full width.
arete
arete10mo ago
the problem was the dropdown on each cell lol thanks tho
Stward
Stward10mo ago
Oh, lol. Good to know it’s been solved then!
Want results from more Discord servers?
Add your server
More Posts