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

Support merged cells #20

Open
doakey3 opened this issue May 11, 2017 · 2 comments
Open

Support merged cells #20

doakey3 opened this issue May 11, 2017 · 2 comments

Comments

@doakey3
Copy link

doakey3 commented May 11, 2017

Let's say I have a .ods file with merged cells like this:

+----------------------+------------+----------+----------+
| Header row, column 1 | Header 2   | Header 3 | Header 4 |
+======================+============+==========+==========+
| body row 1, column 1 | column 2   | column 3 | column 4 |
+----------------------+------------+----------+----------+
| body row 2           | Cells may span columns.          |
+----------------------+----------------------------------+
| body row 3           | Cells may  | - Table cells       |
+----------------------+ span rows. | - contain           |
| body row 4           |            | - body elements.    |
+----------------------+------------+---------------------+

Then if I do:

import pyexcel_ods

data = pyexcel_ods.get_data('example.ods')
pyexcel_ods.save_data('example.ods', data)

The resulting table loses it's merged cells and looks like this:

+----------------------+-------------------------+------------------+----------+
| Header row, column 1 | Header 2                | Header 3         | Header 4 |
+======================+=========================+==================+==========+
| body row 1, column 1 | column 2                | column 3         | column 4 |
+----------------------+-------------------------+------------------+----------+
| body row 2           | Cells may span columns. |                  |          |
+----------------------+-------------------------+------------------+----------+
| body row 3           | Cells may               | - Table cells    |          |
|                      | span rows.              | - contain        |          |
|                      |                         | - body elements. |          |
+----------------------+-------------------------+------------------+----------+
| body row 4           |                         |                  |          |
+----------------------+-------------------------+------------------+----------+

Is there any way to maintain merged cells? Thanks.

@Durman
Copy link

Durman commented Jul 18, 2018

@doakey3 Did you solve your problem somehow?

@doakey3
Copy link
Author

doakey3 commented Jul 18, 2018

I needed to convert html tables into rst tables and was using pyexcel to do it until I hit the issue above. I ended up writing dashtable to do this, but I haven't found a fix for pyexcel.

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