Colored dataframe

Hi Everyone,

How can I make a colored dataframe. I've tried grid.arrange() and It wasn't a successful trial

Thanks :slightly_smiling_face: :slightly_smiling_face:

What have you tried (please provide some example of your code) and what is your end-goal? You mention making a "colored dataframe" - how do you envision it being colored? Conditional formatting?


Thanks for your reply. It's just a normal csv dataframe nothing special about it.
No need for conditional formatting, I Just wanna color the rows like how we'd do it with google sheets for example rather than the grey and white appearance.

The R console can only support primitive coloring, and not offer you control over font and fine presentation details by virtue of what it is; similarly R studio table viewer is primitive and not intended to be used as a presentational tool. Therefore there is a sort of divide you should conceptualise between working data structures for calculation, and finished presentational products such as attractive HTML tables fit for reporting.

If you would like to transform a data.frame for the purpose of presentation you should look into using an appropriate package that can render a table visually for presentation/reporting.
Perhaps gt is a good choice.
Easily Create Presentation-Ready Display Tables • gt (

This topic was automatically closed 21 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.