Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode-bidi side-effect of coloured bar numbers becoming misaligned in Chrome/Firefox #120

Open
jrwishart opened this issue Sep 10, 2019 · 1 comment

Comments

@jrwishart
Copy link

jrwishart commented Sep 10, 2019

The addition of "unicode-bidi" = "plaintext" in 4de31bb to fix placement of symbols has an undesirable side-affect where in some browsers it breaks the direction of text causing RTL alignment to change to LTR.

image-20190909-031528

Above is a screenshot of output on different web browsers with versions with manual hack removing the unicode-bidi attribute from the table.

Source of output also available here at JSfiddle

Minimal reproduceable example is given with

library(formattable)
library(tibble)
test_tbl = tribble(~colA, ~colB, ~colC, ~colD, ~Test, ~Behaviour,
                   "a",    1000,  1001,  1002, 22.28,   "Good",
                   "b",    2000,  2001,  2002, 15.53,   "Good",
                   "c",    3000,  3001,  3002,  4.48,  "Browser dependent",
                   "d",    4000,  4001,  4002,  8.27,  "Browser dependent")
formattable(test_tbl, list(`Test` = color_bar("#FA614B")))
@jrwishart jrwishart changed the title unicode-bidi side affect of coloured bar numbers becoming misaligned in Chrome/Firefox unicode-bidi side-effect of coloured bar numbers becoming misaligned in Chrome/Firefox Sep 10, 2019
@chschan
Copy link

chschan commented Jul 10, 2020

As an update on this, you can avoid these alignment problems by not using "unicode-bidi" = "plaintext" but instead prepending the cell contents with the left-to-right mark. (Use the unicode \u200e instead of the html entity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants