haozhu233 / kableExtra

Construct Complex Table with knitr::kable() + pipe.
https://haozhu233.github.io/kableExtra/
Other
688 stars 147 forks source link

Move linebreak into kable_styling? #284

Open hyperkomplexe opened 5 years ago

hyperkomplexe commented 5 years ago

Because there's two different functions linebreak and linebreak_html, should these be put into kable_styling?

If someone wants to generate both html and latex outputs, then they have to manually change from one to the other when generating the documents.

Does it make sense to integrate linebreak & linebreak_html into kable_styling?

haozhu233 commented 5 years ago

I think that linebreak_html is probably a piece of legacy code that should be removed. Linebreak doesn't seem like an issue in html (people can put in <br> by themselves?).

Something that can possibly be done is that I can try to integrate this linebreak_html into knitr::kable so it sort of solve this problem from the root. I will think about that.

hyperkomplexe commented 5 years ago

Ok thanks!

siimsober commented 4 years ago

There is still no good solution to generating both html and latex tables with line breaks. linebreak() only works in latex and manually adding <br> only works for html.

Perhaps adding

if(is_html_output()) {return(linebreak_html(x))} to linebreak() could work?