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

Fix the issue that the first header is still right aligned #514

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

shrektan
Copy link
Collaborator

@shrektan shrektan commented Feb 26, 2018

Fix the issue that the first header is still right aligned when the data has no row name and the target is set to "_all". It's a patch for #512 .

some examples

DT::datatable(
  data.frame(a = 1, b = 2, c = 3, d = 4),
  options = list(
    columnDefs = list(
      list(className = "dt-center", targets = "_all")
    )
  )
)

DT::datatable(
  data.frame(a = 1, b = 2, c = 3, d = 4),
  options = list(
    columnDefs = list(
      list(className = "dt-center", targets = c(-1, 2))
    )
  )
)


DT::datatable(
  sapply(iris[,1:3], as.integer),
  options = list(
    columnDefs = list(
      list(className = "dt-center", targets = "_all")
    )
  )
)


DT::datatable(
  iris[,1:3], rownames = FALSE,
  options = list(
    columnDefs = list(
      list(className = "dt-center", targets = "_all")
    )
  )
)

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yihui yihui merged commit d60e9ea into rstudio:master Feb 26, 2018
@yihui yihui mentioned this pull request Feb 26, 2018
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants