I have a table in a word document that would have merged cells and I am trying to extract data via the word addin using office.js
Example:
I want to gather data in json i.e. for each headers an array pointing out the values present for them i.e.
- Table expected result
{
"Header 0,0": [['Cell 1.1', 'Cell 2.1']],
"Header 3": [['Cell 3']],
"Header 4": [['Cell 4']],
"Header 5,6": [['Cell 5.1', 'Cell 6.1']],
}
Currently I have tried the approach to fetch the values from the table via office.js Table class object and directly iterating over the values but I am getting the following 2D array from it,
[
['Header 0,0', 'Header 3', 'Header 4', 'Header 5,6'],
['Cell 1.1', 'Cell 2.1', 'Cell 3', 'Cell 4', 'Cell 5.1', 'Cell 6.1']
]
From the above value we would not be able to form a relation of header to its data cells.
