Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create table with vertical header? <th> as a row #331

Open
nabiila-29 opened this issue Jul 10, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@nabiila-29
Copy link

Example:
image

The idea is to create an information like above without any border

@glin
Copy link
Owner

glin commented Jul 25, 2023

Hi, I think this is technically possible if you hide the column headers with CSS and mark up a column as row headers (to be effectively the same as <th>). But I wouldn't really recommend it with reactable, as pretty much every feature assumes a column-wise table. There won't be any useful pagination, filtering, sorting, etc. So I'd really recommend creating this manually as an HTML table or using a different package.

To hide column headers and mark up a column as row headers, here's a quick example:

reactable(
  MASS::Cars93[, c("Model", "Manufacturer", "Min.Price")],
  columns = list(
    Model = colDef(rowHeader = TRUE, style = list(fontWeight = "bold"))
  ),
  defaultColDef = colDef(headerStyle = list(display = "none")),
  bordered = TRUE
)

@glin glin added the enhancement New feature or request label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants