
Because the text can be "the same" in different cells, such judgment is not "rigorous". However, it is obviously inappropriate to judge whether to merge cells through the text of cells. In the docx library, read the text in the merged cells and get all the same content. If it is Excel, you can also get the information of merged cells while reading the table, but this method is not supported in the docx library. Where is the problem? The table read by docx library considers that there are merged cells in it, and regards it as 2 × Table 3. For example, when the table is like this: The table is generally read in this way: def ReadDocx(file): Pip install python-docx 1.1 conventional writing The installation method of pip is as follows:

Note that the installation name of docx library is Python docx instead of docx. I usually use docx library to process Word tables.
