customise shiny R data tables - css

Is it possible to apply customize css file to change appearance of dataTable in R Shiny? I tried applying
shinyUI(fluidPage(theme = "bootstrap.css",
at the beginning but it does not effect the row colour of the table.

You need to first create a 'www' directory inside your app directory. Download "bootstrap.css" and put it in there.
Compile and run!
It must work.

Related

R 3.5.1 shiny dashboard theme change

I want to connect external css file for R shiny dashboard. I am using R 3.5.1. I have downloaded cerulean theme as bootstrap.css in www directory. Using the code below
dashboardBody(
tags$head(
tags$link( rel="stylesheet",
type='text/css',
href = 'bootstrap.css'))
But cerulean theme is not appearing in shiny app.
Also I want to change the search input box displaying in 3D to 2D. Please have a look below:
New search input box should appear like below
I have no idea why the following works, but from experience: just renaming the .css file in your www folder and, ofcourse, in the .R file gets it working.
Your code seems fine.
Alternatively you may try includeCSS(). For this you should put your CSS in your app directory.
shinyUI(fluidPage(
includeCSS("styles.css"),
...

codename one using gui builder and css.

I am building a cn1 app and was so far using the "Theme" in the GUI Builder to change the look of containers and buttons. I now want to add a specific border to a container and I find it easier to accomplish the border through css, I found the instructions on how to do it and the code here: https://www.codenameone.com/blog/rounded-corners-shadows-and-gradients-with-css.html . I added the .jar, made a css folder and add my theme.css file with the code. In my form's beforeshow method I change the uiid of a container to the uiid defined in my theme.css. However when I run the app the container takes on the default Container uiid, not the one defined in my .css. I feel like this is because I already have a theme defined in my gui builder with my uiids and now I am trying to change a container's uiid to a uiid defined in another theme. Is there something I'm doing wrong here?
If I understand correctly you have two themes and you want to use elements from both in the app. There are two valid scenarios, one where both of the themes are in the same res file and another where both of the themes are in a separate file.
If they are in the same res file do this:
theme = UIManager.initNamedTheme("/theme", "firstTheme");
UIManager.getInstance().addThemeProps(theme.getTheme("secondTheme"));
If they are in a separate files do this:
theme = UIManager.initNamedTheme("/theme", "firstTheme");
Resources otherTheme = Resources.openLayered(("/otherTheme");
UIManager.getInstance().addThemeProps(otherTheme.getTheme("secondTheme"));
This is discussed in the Codename One Developer Guide under Theme Layering.

Multiple css styles in shiny R markdown

I create a lot of R Markdown files using the shiny runtime that have multiple interactive components, usually each one is wrapped in shinyUI(). I would like to be able to style the different interactive sections separately, but haven't been able to figure out how. I have tried using includeCSS() in different fluidPage() components, but the first one is always loaded and the rest ignored. Can this be done easily?
I've never tried having multiple shinyUI() on the same page, but here's what I can think of:
Wrap each shiny app in an html tag with a different id, load all the css in one script, and in the css rules just specify which id the rule should fall under

Style Drupal's Print Module PDF

How would one do this in Drupal 7? I want to add a few small style edits to the way the PDF outputs. I am using TCPDF. I read somewhere that its not posible with TCPDF, but other sources say it is. Should I be switching to dompdf? I've read the documentation but just can't seem to understand which file generates the PDF.
I have the module successfully generating a PDF from a View, so this is the last step in moving on with this project.
For anytime you want to style PDFs use DOMPDF, it will be less painful. Then style your pdf using print.css in the sites/domain.com/themes/yourtheme/css folder.
You can also copy the print.tpl.php file from the module's folder and paste it in sites/domain.com/themes/yourtheme/templates to choose exactly what you want to display in your pdf.

How to apply CSS to created pdf file in ASP.NET

I have generated a pdf file using third party now I want apply my own style to the content in pdf.
Can I insert an External CSS File into a generate PDF.
I have tried many ways but all is not working.
Thanks,
You cannot style an already generated PDF with CSS. It is not made out of selectable elements and there is no way to link the CSS to the PDF.
You will have to do the styling before the PDF is created. It's like trying to add more sugar to an already baked cake, there is no way to do it.

Resources