How can we fix row width of the read xlsm file in Shiny

Hi Shiny experts,

How can we fix the width of the each row.
Here is an example code and sample data file (sample data)to reproduce error:

library(shiny)
library(readxl)

runApp(
  list(
    ui = fluidPage(
      titlePanel("Use readxl"),
      sidebarLayout(
        sidebarPanel(
          fileInput('file1', 'Choose xlsx file',
                    accept = c(".xlsx")
          )
        ),
        mainPanel(
          tableOutput('contents'))
      )
    ),
    server = function(input, output){
      output$contents <- renderTable({
        
        req(input$file1)
        
        inFile <- input$file1
        
        readxl::read_excel(inFile$datapath, 1)
      })
    }
  )
)

As we observe, the 1st and 2nd row width are not same. Is there a possibility may be using "DT" to fix row width ?

You can use renderDataTable() instead and do all the customization you want

https://rstudio.github.io/DT/shiny.html

Thanks for suggestion....I changed code for DT but still not sure which parameter to alter....

I tried lengthChange = FALSE and Autowidth but this is nothing to do with row widths

DT options

Take a look at this SO answer

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.