Skip to content

Support merged cells #20

Open
Open
@doakey3

Description

@doakey3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions