microsoft / microsoft/fluentui

[Bug]: DataGrid component doesn't support native HTML table attributes (colspan)

Open
#30,102 6 comments 0 reactions 1 assignee View on GitHub

@ling1726 is already working on this.

Since Jan 16, 2024.

Component: DataGrid Fluent UI react-components (v9) Resolution: Soft Close Type: Feature
Dominant language
TypeScript
Stars
20.3k
Forks
2.9k
Avg merge
2d 9h
Merged PRs (30d)
46

Description

Library

React Components / v9 (@fluentui/react-components)

System Info
.
Are you reporting Accessibility issue?

None

Reproduction

https://codesandbox.io/p/sandbox/epic-wildflower-j46jp6?file=%2Fsrc%2Fexample.tsx%3A178%2C27

Bug Description

Actual Behavior

Adding colspan on <DataGridHeaderCell> doesn't reflect this attribute on <th> HTML Element

Expected Behavior

Adding colspan on <DataGridHeaderCell> should reflect this attribute on <th> HTML Element

Thus, there is no actual way to make a <th> span more than one column, to create a main and a sub table headers/columns.

Example of how it works in actual HTML table

  <thead>
    <tr>
      <th colspan="2" scope="colgroup">main table header</th>
    </tr>
    <tr>
       <th scope="col">sub table header 1</th>
       <th scope="col">sub table header 2</th>
   </tr>
  </thead>
  .
  .
  .

Output:

image

Logs

No response

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.