0

I am creating a flexdashboard for a project. I have valuebox in the first row. Second row has a table and 3rd row has an interactive plot.

Problem Statement: The table has about 20ish columns. I want a horizontal scroll bar on the Datatable. When I try to use the horizontal scroll bar which is on the entire page, the table looks distorted as shown in the picture. I want all the three boxes to have same width and have a horizontal scroll bar on the second row.

Secondly, I want the table to fit the entire box.

enter image description here

Code:

R Markdown file can be downloaded from the link below:

https://drive.google.com/file/d/1IY43xY_Cuu662e78cDyV0L5Zkg9ef0QV/view?usp=sharing

Deepansh Arora
  • 724
  • 1
  • 3
  • 15
  • Can you show us a [mre] of your code in the question? It is often better to do that instead of relying on external links, if possible. – andrewJames Jun 24 '22 at 17:03
  • Have you looked at [How to make the horizontal scrollbar visible in DT::datatable](https://stackoverflow.com/q/30765338/12567365)? Does that contain answers which solve your problem? Do other similar questions help? – andrewJames Jun 24 '22 at 17:03
  • @andrewJames I generally add the code in the post itself, but since this is flexdashboard and I have code chunks, that was causing issues in the post and the post was looking very big. Therefore, I added the entire file on a separate link. I did try to add "scrollX=T" in the options but nothing happens. – Deepansh Arora Jun 24 '22 at 17:43
  • The "m" in MRE stands for "mimimal" - the smallest and simplest amount of code which still demonstrates the problem. Maybe you will solve it yourself, in the process of creating a MRE - that would be a good outcome! But I understand that may not be possible here. – andrewJames Jun 24 '22 at 18:35
  • Do you by chance have a wide screen monitor? Looks like DT Tries really hard to not have to auto add a scrollX bar if it doesn't have to, if you dragged the web browser window into half the size, does your dashboard auto adjust with DT adding scroll bars? Posting plain text code would be preferred in your question so we can all see the code here. – Daniel_j_iii Jul 10 '22 at 13:05

0 Answers0