Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHow to freeze columns in reactable #19
Comments
|
You can freeze columns using the I think it'd be nice to build this into reactable in the future, but for now, you'll have to add some likely-messy CSS yourself. I've created some examples of single/multiple sticky columns here: Also note IE11 doesn't support |
|
Is there a way to freeze the checkbox column too? As a simple example, when using a selectionId you will see the checkbox column does not stick:
|
|
@analytichealth I just added the ability to customize the row selection column to make that easier: https://glin.github.io/reactable/articles/examples.html#customize-the-selection-column You can now add inline styles or classes to the selection column like this: reactable(
MASS::Cars93,
selection = "multiple",
columns = list(
.selection = colDef(
style = list(position = "sticky", left = 0, background = "#fff", zIndex = 1),
headerStyle = list(position = "sticky", left = 0, background = "#fff", zIndex = 1)
)
)
)Here are some examples of freezing the selection column: https://glin.github.io/reactable/articles/sticky-columns-selection.html. The only other tricky part is that selection columns have a different, undocumented default width (36px), so I'd recommend setting the width explicitly, in case the default ever changes. |

if we need to freeze 5 left most column and provide a horizontal scroll bar afterwards, how do we do that with reactable?