Comments (3)
One possible solution to this is the following:
formattable(df, list(
test1_score = formatter("span",
style = ~ style(
display = "block",
width = percent(normalize(c(test1_score, test2_score), min = 0.25)[seq_along(test1_score)]),
"border-radius" = "4px",
"padding-right" = "4px",
"background-color" = "lightpink"
)),
test2_score = formatter("span",
style = ~ style(
display = "block",
width = percent(normalize(c(test2_score, test1_score), min = 0.25)[seq_along(test2_score)]),
"border-radius" = "4px",
"padding-right" = "4px",
"background-color" = "lightpink"
))
))
where df
is the data.frame
in the README example. The code uses the syntax style = ~style()
in formatter()
to refer to any columns in the data.frame
which is newly introduced in #34.
from formattable.
In v0.2, area formatting is supported so that you can apply formatter function over an area with the same benchmark.
from formattable.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
from formattable.
Related Issues (20)
- Embed hyperlink into Glyphicon HOT 3
- Support fontawesome HOT 1
- Feature Request: easy creation of image columns HOT 2
- Make formattable work with promises-package HOT 3
- Warning: Error in writeImpl: Text to be written must be a length-one character vector HOT 5
- Extract vector classes to a separate package?
- latex output
- Retire Travis and AppVeyor HOT 9
- Change header text by icontext
- invisible white text when rendering a table in knitr chunk HOT 3
- Update NEWS and create tag HOT 2
- Feature Request - Implement vctrs methods to support tidyr
- digit number HOT 2
- Is there a way to save formattable to pure html, not through htmlwidgets?
- Does formattable has similar function as `merge_v` in `flextable`?
- Formattable + DT Sorting Issue with multi colour bars.
- No formatted table produced HOT 4
- Use of hex codes within style() HOT 1
- conflict with patchwork HOT 2
- replace glyphicons with FontAwesome ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formattable.