Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

In larger tables, columns become collapsed on top of each other #137

Open
stevenlockton-progenity opened this issue Sep 21, 2021 · 10 comments

Comments

@stevenlockton-progenity
Copy link

stevenlockton-progenity commented Sep 21, 2021

Hello,

When tables (printed by knitr::kable()) become a certain size some columns collapse together. It's an odd bug that has only recently become apparent.

Here's what I expect (3 x 10 table example used)
image

And here's what happens (22 x 50 table example)
image

Here is some code to reproduce the bug that can be used in a conflr confluence_document.

make_fake_data_table <- function(nrows, ncolumns) {
  set.seed(123)
  n <- ncolumns * nrows
  mx <- matrix(
    data = rnorm(n),
    nrow = nrows,
    ncol = ncolumns
  )
  df <- data.frame(
    A = 1:nrows,
    B = letters[1:nrows],
    C = factor(LETTERS[1:nrows]),
    mx
  )
  return(df)
}

fake_dt <- make_fake_data_table(
  nrows = 22,
  ncolumns = 50
)

knitr::kable(fake_dt)

At some size of data frame this issue goes away - it's not a simple "below x columns it's fine" because it also depends on the row number too. I haven't yet pinpointed that place (working on it!).

Any ideas on what's causing this?

@yutannihilation
Copy link
Contributor

Thanks for reporting! I have no idea on conflr's side. If you manually create 22 x 50 table on editor, what will happen? As you say

It's an odd bug that has only recently become apparent.

I'm wondering if this is something on Confluence's side.

@stevenlockton-progenity
Copy link
Author

@yutannihilation
Copy link
Contributor

I’m guessing it’s something to do with atlassian’s recent api updates.

Ah, this sounds possible... Thanks. I know one recent API change on Confluence Cloud #125 (comment), they changed the default editor to the new one, so it might matter here. Do you use Confluence Cloud?

@stevenlockton-progenity
Copy link
Author

@yutannihilation
Copy link
Contributor

No option at the moment. I need to implement the feature to switch between new and old, but I couldn't find time for this, sorry. Still not sure if using the old editor will solve this issue, but I'll try to implement it, hopefully soon. Feel free to ping me for this!

@stevenlockton-progenity
Copy link
Author

@stevenlockton-progenity
Copy link
Author

If you need help with this feature (namely, selecting which editor to use when publishing to confluence cloud), let me know. I might be able to assist. When do you think you'd be able to work on this?

@yutannihilation
Copy link
Contributor

No idea, hopefully next week, or next month :)

@yutannihilation
Copy link
Contributor

@stevenlockton-progenity
Sorry for the delay, I created a new space on Confluence Cloud and tested. A good news is that I can reproduce your issue so I guess it's a problem on Confluence's side. A bad news is, however, I couldn't find the way to publish it in the legacy editor...

It seems this requires the owner to ask Atlassian to enable the legacy editor. Considering this, I feel this is not what I can expect is available on the usual setup, so I'm deciding not to provide this "switch" feature.

https://community.atlassian.com/t5/Confluence-questions/I-have-the-new-editor-is-it-possible-to-have-the-legacy-editor/qaq-p/1372761

An workaround for this particular issue seems that we can change the width setting (sorry the caption is in Japanese) by clicking this. Of course, it's annoying that we have to edit the page every time we publish wide tables, but this might be a bit better than the status quo...

image

@stevenlockton-progenity
Copy link
Author

Thanks @yutannihilation!

I don't often make huge, wide tables, so this is perhaps a good workaround.

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

No branches or pull requests

2 participants