Comments (3)
You may try something like the following:
library(formattable)
formattable(mtcars, list(
mpg = formatter("a",
href = x ~ sprintf("http://test.com/page?value=%s", x),
style = x ~ style(color = ifelse(x, "green", "red")),
x ~ icontext(ifelse(x >= mean(x), "ok", ""), ""))
))
<a href="http://...">
instead of <span>
is used in the formatter to create hyperlinks.
from formattable.
Hi, thanks for the suggestion, it worked perfectly.
Just another thing to ask before closing the issue, do you have any plans to incorporate the fontawesome
package instead of using Glyphicons, or as an alternative choice? Part of what I am doing required me to use the fontawesome::fa()
command to access some additional icon sets.
from formattable.
Glad to know that it works for you.
We use Glyphicons by default because it is available in bootstrap out of the box. I'll take a look at https://github.com/rstudio/fontawesome and see how we could support it.
from formattable.
Related Issues (20)
- 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.