Skip to content

Styling guide #3173

Closed

Description

@paddymul

Use case

Is there any explanation of all the ways to style a table, and common practices.

Proposed solution

I would like to see advice for how to set width and height specifically. inline style seems to work, css classnames don't. Also the data grid doesn't respect it's parent's width width:100% . What are the best practices?

Activity

  1. VerioN1 commented on Apr 11, 2023

    @VerioN1

    do you have an open repo that you had to style the grid?
    I don't know how to style it with only style

  2. paustint commented on Apr 11, 2023

    @paustint

    I only made very minor customizations, so not a great resource for anything large-scale - this information is extremely basic and far from a "style guide".

    <DataGrid
      ...
      className="rdg-light fill-grid"
      ...
    

    Then for columns I have used cellClass and summaryCellClass etc.. to control some additional styles.

    Aside from that I was able to use formatter to control what I needed for my cell styles. Note that for any cells that need to have multi-line values, you need to make sure to set the line height to 1 for your formatter component.

    These are the only global overrides I ended up making:
    scss

    .rdg {
      &.fill-grid {
        block-size: 100%;
      }
    
      .select-checkbox {
        display: flex;
        align-items: center;
        justify-content: center;
        > input {
          margin: 0;
        }
      }
    
      .rdg-checkbox {
        &:checked {
          outline: 'none !important';
        }
      }
    }

    All this is probably of little help - but hopefully helps someone.
    I am using a ton of data table components spread out throughout the repo, but here is my data table wrapper component if you wanted to check it out
    https://github.com/jetstreamapp/jetstream/blob/main/libs/ui/src/lib/data-table/DataTable.tsx

  3. rohit-squirrel commented on Jul 25, 2023

    @rohit-squirrel

    I am also facing the same. Css className does not work

  4. stuartambient commented on Jul 25, 2023

    @stuartambient

    I am also facing the same. Css className does not work

    Try this maybe ? Not sure if it is directly related but it helped me with getting the grid itself to work.

  5. linked a pull request that will close this issueExpand styling and customization docs #3933on Dec 19, 2025
  6. added theissue type on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions