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

Cannot justify cell #341

Open
ShixiangWang opened this issue Sep 7, 2019 · 0 comments
Open

Cannot justify cell #341

ShixiangWang opened this issue Sep 7, 2019 · 0 comments

Comments

@ShixiangWang
Copy link

Dear developers,

I found I cannot align some columns like members, books, is there a solution?

Best,
Shixiang

> test <- 
+ structure(list(login = c("elegant-r", "biotrainee", "hidden"), 
+                name = c("优雅R", "生信技能树", "隐藏库"), books = c(1L, 
+                                                           2L, 0L), topics = c(0L, 0L, 0L), members = c(1L, 54L, 1L), 
+                description = c("「优雅R」公众号", "生信技能树 创建于\n2016年8月,是中国第\n一家专注于生信知识体\n系完善、促进生信学习\n交流的论坛。我们通过\n收集国内外生信学习资\n源,邀请大神分享的领\n域专业知识,发布菜鸟\n的真实学习笔记,搭建\n生信技术人员联盟,", 
+                                "用来测试")), class = c("tbl_df", "tbl", "data.frame"
+                                ), row.names = c(NA, -3L))
> test
# A tibble: 3 x 6
  login     name     books topics members description                                                                             
  <chr>     <chr>    <int>  <int>   <int> <chr>                                                                                   
1 elegant-r 优雅R        1      0       1 「优雅R」公众号                                                                         
2 biotrain… 生信技能树…     2      0      54 "生信技能树 创建于\n2016年8月,是中国第\n一家专注于生信知识体\n系完善、促进生信学习\n交流的论坛。我们通过\n收集国内外生信学习资\n源,邀请大神分享的领\n域…
3 hidden    隐藏库       0      0       1 用来测试                                                                                
> pander::pandoc.table(test)

---------------------------------------------------------------------------
   login         name      books   topics   members       description      
------------ ------------ ------- -------- --------- ----------------------
 elegant-r      优雅R        1       0         1        「优雅R」公众号    

 biotrainee   生信技能树     2       0        54       生信技能树 创建于   
                                                      2016年8月,是中国第  
                                                      一家专注于生信知识体 
                                                      系完善、促进生信学习 
                                                      交流的论坛。我们通过 
                                                      收集国内外生信学习资 
                                                      源,邀请大神分享的领 
                                                      域专业知识,发布菜鸟 
                                                      的真实学习笔记,搭建 
                                                       生信技术人员联盟,  

   hidden       隐藏库       0       0         1            用来测试       
---------------------------------------------------------------------------

> pander::pandoc.table(test, justify = "left")

---------------------------------------------------------------------------
login        name         books   topics   members   description           
------------ ------------ ------- -------- --------- ----------------------
elegant-r    优雅R        1       0        1         「优雅R」公众号       

biotrainee   生信技能树   2       0        54        生信技能树 创建于     
                                                     2016年8月,是中国第   
                                                     一家专注于生信知识体  
                                                     系完善、促进生信学习  
                                                     交流的论坛。我们通过  
                                                     收集国内外生信学习资  
                                                     源,邀请大神分享的领  
                                                     域专业知识,发布菜鸟  
                                                     的真实学习笔记,搭建  
                                                     生信技术人员联盟,    

hidden       隐藏库       0       0        1         用来测试              
---------------------------------------------------------------------------

> pander::pandoc.table(test, justify = "left", style = "grid")


+------------+------------+-------+--------+---------+----------------------+
| login      | name       | books | topics | members | description          |
+============+============+=======+========+=========+======================+
| elegant-r  | 优雅R      | 1     | 0      | 1       | 「优雅R」公众号      |
+------------+------------+-------+--------+---------+----------------------+
| biotrainee | 生信技能树 | 2     | 0      | 54      | 生信技能树 创建于    |
|            |            |       |        |         | 2016年8月,是中国第  |
|            |            |       |        |         | 一家专注于生信知识体 |
|            |            |       |        |         | 系完善、促进生信学习 |
|            |            |       |        |         | 交流的论坛。我们通过 |
|            |            |       |        |         | 收集国内外生信学习资 |
|            |            |       |        |         | 源,邀请大神分享的领 |
|            |            |       |        |         | 域专业知识,发布菜鸟 |
|            |            |       |        |         | 的真实学习笔记,搭建 |
|            |            |       |        |         | 生信技术人员联盟,   |
+------------+------------+-------+--------+---------+----------------------+
| hidden     | 隐藏库     | 0     | 0      | 1       | 用来测试             |
+------------+------------+-------+--------+---------+----------------------+

Test data:

> dput(test)
structure(list(login = c("elegant-r", "biotrainee", "hidden"), 
    name = c("优雅R", "生信技能树", "隐藏库"), books = c(1L, 
    2L, 0L), topics = c(0L, 0L, 0L), members = c(1L, 54L, 1L), 
    description = c("「优雅R」公众号", "生信技能树 创建于\n2016年8月,是中国第\n一家专注于生信知识体\n系完善、促进生信学习\n交流的论坛。我们通过\n收集国内外生信学习资\n源,邀请大神分享的领\n域专业知识,发布菜鸟\n的真实学习笔记,搭建\n生信技术人员联盟,", 
    "用来测试")), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -3L))
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

1 participant