如何修改此DT主题以使其看起来更像另一个

问题描述 投票:2回答:1

你好我在R这个datatable javascript library的端口使用

当我渲染表格时,“外观”如下所示:notice the round edges

我注意到一个使用相同库的python dash应用程序,看起来像下面的notice the square edges

在R我的代码看起来像这样,问题可能是“主题”,我怎么能修改“圆形”,所以看起来更像是“方形”

   table = datatable(data,   
                      width='100%', 
                      selection=list(mode='multiple', target='column'), 
                      style='bootstrap', 
                      filter = list(position = 'top', clear = TRUE, plain = FALSE), 
                      extensions = c('Buttons', 'ColReorder'), 
                      options = list(pageLength=30, autoWidth=TRUE, columnDefs=list(list(classname='dt-center')), dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel'), colReorder=TRUE)) %>% 
    formatStyle( 0, target= 'row',color = 'black', fontWeight ='bold', lineHeight='50%')

谢谢

r datatables shiny dt
1个回答
0
投票

正如我在评论中所说的那样,我不明白你的意思,因为对我而言,盒子是方形的。

无论如何,如果你想控制盒子的圆度,你可以这样做:

datatable(head(iris),   
          filter = list(position = 'top', clear = TRUE, plain = FALSE),
          options = list(
            initComplete = JS("function(settings){
              $('input[type=\"search\"]').each(function(){
                $(this).css('border-radius','100px'); // set to 0 for square boxes
              })
            }")
          )
) %>% 
  formatStyle( 0, target= 'row',color = 'black', fontWeight ='bold', lineHeight='50%')
© www.soinside.com 2019 - 2024. All rights reserved.