Skip to content

Vertically align text in a table cell #177

@ixodid198

Description

@ixodid198

I wish to vertically center the text in my "Letter" column, which is tall because of the content in the adjacent "Numbers" column. I require the horizontal alignment of the "Letter" column to remain left-justified.

How do I do this with a Reactable table?

library(reactable)

x <- as.character(1:100) |> 
  paste0(collapse = ", ")

df <- tibble(
  Letter = LETTERS[1:3],
  Numbers = rep(x, 3)
)

reactable(df,
          compact = TRUE,
          fullWidth = FALSE,
          
          columns = list(
            Letter = colDef(
             align = "center"
            ),
            Numbers = colDef(
              width = 400
            )
          )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions