carbone icon indicating copy to clipboard operation
carbone copied to clipboard

[Bug Report]: Repetitions do not work for table columns

Open waltermaldonado opened this issue 5 years ago • 4 comments

Environment Carbone Version: latest Node Version: 13 Browsers: chrome latest Desktop OS: ubuntu 18.04

Expected Behaviour The repetitions to work for table columns the same way they work for rows.

Actual Behaviour Only the two first columns of the table are rendered if there are more in the data

image image

waltermaldonado avatar Jan 16 '20 20:01 waltermaldonado

It is a known issue, it has been already reported: https://github.com/Ideolys/carbone/issues/45#issuecomment-575291236 We will look deeper at the issue and come back to you. Thank you for the issue and the example!

steevepay avatar Jan 20 '20 15:01 steevepay

Why is it taking much time to fix?

Musbell avatar Jan 21 '20 19:01 Musbell

So I've been doing a bit of investigation here in the hope that I could either solve it or at least figure out a workaround. For now the best workaround I've come up with is splitting my array into 2 element slices and having multiple (i, ,i+1) paired columns in the table based on the number of entries in the array. This limits it to only supporting arrays of length N to 2N where N is the number of pairs you have, and does involve some data wrangling on the input values to split them across the groups as needed.

The cause of the issue is actually the structure of the odt - it correctly inserts the rows in the table with the right number of table cells but the table columns aren't being adjusted to add the extra columns. In the image below I have 5 table cells (the first row of labels and 4 generated columns) but the table header only defines 3 columns.

Screenshot_20210312_211722

Haegin avatar Mar 13 '21 02:03 Haegin

For anyone else looking to workaround this, if you save the template in docx format it can generate more than 2 columns. It's just an issue with odt files.

Haegin avatar Mar 13 '21 04:03 Haegin