Skip to content

Column grouping in current data-table #1524

Answered by AmGhGitHub
sammykisina asked this question in Q&A
Discussion options

You must be logged in to vote

I have faced the same issue and I thought it is a bug in shadcn ui. Turned out to be a bug in my implementation. Make sure you have adjusted the table definition and include the colSpan={header.colSpan} in TableHead definition

          <TableHeader>
            {table.getHeaderGroups().map((headerGroup) => (
              <TableRow key={headerGroup.id} className="bg-zinc-300 text-black">
                {headerGroup.headers.map((header) => {
                  return (
                    // console.log(header),
                    <TableHead key={header.id} colSpan={header.colSpan}>
                      {header.isPlaceholder
                        ? null
                        : flexR…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@sammykisina
Comment options

@anandagodini
Comment options

Comment options

You must be logged in to vote
2 replies
@sammykisina
Comment options

@myoaung99
Comment options

Answer selected by sammykisina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants