Sometimes you may need to add appendix tables or tables of raw data to your Displayr document. If you want to add very customized formatting to these tables you can create an Autofit or CreateCustomTable R Table, but these tables try to fit all of the data in the size of the output. This article describes how to go from an Autofit or CreateCustomTable R table where some of the data is cut off or too scrunched (note the below table actually has 600 rows):
To one that has scrolling enabled:
- An Autofit table (see How to Create an Autofit Table) or CreateCustomTable R Table (see How to Create a CreateCustomTable R Table of Sample Sizes)
Method - Autofit table
We will edit the underlying R CODE of the autofit table to set the row height a certain size instead of having row heights "fit" the space available. This will trigger the scroll to show up.
- Select your Autofit table.
- Go to Properties > R CODE and use Ctrl+F to find the line of code for
- Insert a line above and paste in code that sets a value for
row.height(note you can change 12px to a different px size based on the font size in your table):
row.height = "12px",
- Click Calculate.
Method - CreateCustomTable R Table
We will use the row.height argument inside CreateCustomTable() to set the height a certain size instead of having row heights "fit" the space available. This will trigger the scroll to show up.
- Click on your Calculation output.
- In the Properties > R CODE box, inside the flipFormat::CreateCustomTable() function, add a line for the
row.heightargument (note you can change 12px to a different px size based on the font size in your table). For example:
#specify the table to be formatted
mytable = table.Q1a.Spontaneous.Awareness.Spontaneous.Awareness.mention
#format using CreateCustomTable - use row.height to make table scroll
- Click Calculate.