В настоящее время у меня есть таблица, построенная с использованием тегов $ table, и у меня есть блестящие элементы ввода внутри тегов $ td. Проблема в том, что я не могу изменить ширину этих элементов.
Я попытался изменить ширину внутри функции ввода, а также добавить стиль с шириной parm к td / th, но это не сработало.
Функция, которая создает таблицу:
create.table = function(tables) {
rowCount <- c(1:nrow(tables))
htmlTbl <-
paste(
"tags$table(
tags$tr(
tags$th('Select'),
tags$th('Confirm'),
tags$th('Reason')
),"
)
for (val in rowCount) {
htmlTbl <- paste(
htmlTbl,"tags$tr(
tags$td(checkboxInput('check",val,"', label=NULL, value=FALSE, width='25px')),
tags$td(selectInput('conf",val,"',NULL, width='50px',
choices = list('Approve' = 1, 'Deny' = 2),selected = NULL)),
tags$td(selectInput('reas",val,"',NULL, width='50px',
choices = list('Still Used' = 1, 'Not Used' = 2),selected = NULL))
)"
)
if (val != length(rowCount))
htmlTbl <- paste(htmlTbl,",")
}
htmlTbl <- paste(htmlTbl,")")
htmlTbl <- eval(parse(text=htmlTbl))
return(htmlTbl)
}
CSS-файл:
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #eeeeee;
text-align: left;
padding: 8px;
white-space: nowrap;
}
tr:nth-child(even) {
background-color: #dddddd;
}
input[type='checkbox'] {
width: 20px;
height: 20px;
line-height: 20px;
}
Взяв CheckBox в качестве примера:
Токовый выход:
| [] ___________________ | col2 ... | col3 ...
Желаемый вывод:
| [] | col2 ... | col3 ...