Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. create.table = function(tables) {
  2. rowCount <- c(1:nrow(tables))
  3. htmlTbl <-
  4. paste(
  5. "tags$table(
  6. tags$tr(
  7. tags$th('Select'),
  8. tags$th('Confirm'),
  9. tags$th('Reason')
  10. ),"
  11. )
  12. for (val in rowCount) {
  13. htmlTbl <- paste(
  14. htmlTbl,"tags$tr(
  15. tags$td(checkboxInput('check",val,"', label=NULL, value=FALSE, width='25px')),
  16. tags$td(selectInput('conf",val,"',NULL, width='50px',
  17. choices = list('Approve' = 1, 'Deny' = 2),selected = NULL)),
  18. tags$td(selectInput('reas",val,"',NULL, width='50px',
  19. choices = list('Still Used' = 1, 'Not Used' = 2),selected = NULL))
  20. )"
  21. )
  22. if (val != length(rowCount))
  23. htmlTbl <- paste(htmlTbl,",")
  24. }
  25.  
  26. htmlTbl <- paste(htmlTbl,")")
  27. htmlTbl <- eval(parse(text=htmlTbl))
  28.  
  29. return(htmlTbl)
  30. }
  31.  
  32. table {
  33. font-family: arial, sans-serif;
  34. border-collapse: collapse;
  35. width: 100%;
  36. }
  37.  
  38. td, th {
  39. border: 1px solid #eeeeee;
  40. text-align: left;
  41. padding: 8px;
  42. white-space: nowrap;
  43. }
  44.  
  45. tr:nth-child(even) {
  46. background-color: #dddddd;
  47. }
  48.  
  49. input[type='checkbox'] {
  50. width: 20px;
  51. height: 20px;
  52. line-height: 20px;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement