Skip to content

Different rendering behaviour in Microsoft Outlook and mobile Email App #540

@leungi

Description

@leungi

As per subject; screenshots attached.

Mobile (as expected)

mobile-email

Microsoft Outlook (style stripped)

outlook-email

Reprex

library(gt)
#> Warning: package 'gt' was built under R version 3.6.3
library(dplyr)
#> Warning: package 'dplyr' was built under R version 3.6.3
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

df <- tibble(`Non Risky` = c(9, 12, 21), `Risky` = c(1, 0, 1)) %>%
  mutate(
    Total = `Non Risky` + Risky,
    `At Risk Percentage` = Risky / Total
  )

df %>%
  gt() %>%
  tab_style(
    style = cell_text(
      color = "white"
    ),
    locations = cells_column_labels(
      columns = everything()
    )
  ) %>%
  tab_options(
    row.striping.include_table_body = FALSE,
    column_labels.font.weight = "bold",
    column_labels.background.color = "black"
  ) %>%
  fmt_percent(vars(`At Risk Percentage`), decimals = 1) %>%
  data_color(
    columns = vars(Risky),
    colors = scales::col_bin(
      c("red", "green"),
      bins = 2,
      domain = c(0, 100)
    ),
    alpha = 0.8
  )

Package version

> packageVersion("gt")
[1] ‘0.2.0.5

Created on 2020-04-10 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions