Closed dgkeyes closed 4 months ago
Hey @dgkeyes , Thanks. It doesn't work with either flextable or gt. If it worked with one of them, we would just use the one that works.
Attached is a pdf showing each version as it knits here.
The flextable version has all the extra tick mark stuff that we've covered before AND drops a row at the page break. The gt version also drops rows and then the second page of the table looks really odd.
PS: I also tried gt_split() with omni_table() and that only returned an error. I haven't worked on debugging it.
We could manually split into two tables as a work around.
Oh yeah, you're right about flextable missing a row. I hadn't noticed that.
So there are two options here:
Let us know what you'd like to do.
Thanks @dgkeyes , I think we just split the tables for now.
Maybe next month we return to this, and see if there's a way to modify the omni_table() function to work with gt_split(), which seems handy.
Hopefully new package updates and bug fixes will take care of this situation and we can go to using flextable(). Surely the issue with printing the tick marks and '= html' in knitted output gets resolved soon. (We still don't know why you are immune to this but Thomas and I aren't).
Ok, I'll close this issue for now, but we can open it back up later.
Video question
The issue here is that tables that go across multiple pages sometimes look odd. The code below gives a reproducible example of tables made with
gt
andflextable
. Thegt
table does not work well across multiple pages but theflextable
one does. @OskaratOmni I believe I have summarized this correctly, but let me know if I've missed anything.I believe the best solution here is to use
flextable
because it just works across pages. However, if you want to usegt
it looks like there is a function to split agt
table into multiple tables. For example:Gives this:
I did try this function and was having trouble getting it to work with the
omni_table()
function. If you want me to look into this more, just let me know. But I wanted to check first because maybe you'll just want to go withflextable
here.Original code you shared is below.
First Level Header
:::wrap-columns :::column-70 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Et ligula ullamcorper malesuada proin libero nunc consequat. Proin libero nunc consequat interdum varius sit. Maecenas pharetra convallis posuere morbi leo. Ipsum dolor sit amet consectetur. Dolor sit amet consectetur adipiscing elit duis tristique. Sit amet cursus sit amet dictum sit. Non sodales neque sodales ut etiam sit amet. Fermentum odio eu feugiat pretium nibh ipsum. Neque aliquam vestibulum morbi blandit cursus risus at ultrices mi. Maecenas pharetra convallis posuere morbi. Bibendum ut tristique et egestas quis ipsum suspendisse. :::
:::column-30
Second Level Header
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Et ligula ullamcorper malesuada proin libero nunc consequat. Proin libero nunc consequat interdum varius sit. Maecenas pharetra convallis posuere morbi leo. Ipsum dolor sit amet consectetur. Dolor sit amet consectetur adipiscing elit duis tristique. Sit amet cursus sit amet dictum sit. Non sodales neque sodales ut etiam sit amet. Fermentum odio eu feugiat pretium nibh ipsum. Neque aliquam vestibulum morbi blandit cursus risus at ultrices mi. Maecenas pharetra convallis posuere morbi. Bibendum ut tristique et egestas quis ipsum suspendisse.
:::stats-block :::stats-number 24 ::: :::stats-content pt. Arial Bold for stats numbers. 11 pt Arial Bold for stats content. ::: :::
Third Level Header
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Et ligula ullamcorper malesuada proin libero nunc consequat. Proin libero nunc consequat interdum varius sit. Maecenas pharetra convallis posuere morbi leo. Ipsum dolor sit amet consectetur. Dolor sit amet consectetur adipiscing elit duis tristique. Sit amet cursus sit amet dictum sit. Non sodales neque sodales ut etiam sit amet. Fermentum odio eu feugiat pretium nibh ipsum. Neque aliquam vestibulum morbi blandit cursus risus at ultrices mi. Maecenas pharetra convallis posuere morbi. Bibendum ut tristique et egestas quis ipsum suspendisse.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Et ligula ullamcorper malesuada proin libero nunc consequat. Proin libero nunc consequat interdum varius sit.
Fourth Level Header
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus faucibus ornare suspendisse sed nisi lacus sed viverra tellus. Et ligula ullamcorper malesuada proin libero nunc consequat. Proin libero nunc consequat interdum varius sit. Maecenas pharetra convallis posuere morbi leo.
Ipsum dolor sit amet consectetur. Dolor sit amet consectetur adipiscing elit duis tristique. Sit amet cursus sit amet dictum sit. Non sodales neque sodales ut etiam sit amet. Fermentum odio eu feugiat pretium nibh ipsum. Neque aliquam vestibulum morbi blandit cursus risus at ultrices mi. Maecenas pharetra convallis posuere morbi. Bibendum ut tristique et egestas quis ipsum suspendisse.
Ipsum dolor sit amet consectetur. Dolor sit amet consectetur adipiscing elit duis tristique. Sit amet cursus sit amet dictum sit. Non sodales neque sodales ut etiam sit amet. Fermentum odio eu feugiat pretium nibh ipsum. Neque aliquam vestibulum morbi blandit cursus risus at ultrices mi.
:::section-header
Section header
:::
With second level 1
Big table 1
And third level A
And second level 2 with a very very very very long title
And third level A
And third level C
And second level 3