Detection of the end of the table

Vlado 60 Reputation points
2025-03-18T11:10:27.8766667+00:00

Hello,
I am working with an old doc (binary) format. Specifically processing tables.
I would just like to ask, is there a reliable way to detect if the next row of a table already belongs to another table?
In most cases, I have successfully detected the end of a table by determining that the next paragraph does not belong to the table.
However, I have encountered a scenario where two different tables are consecutive (all paragraphs belonging to the table - without a separating paragraph not belonging to the table).

The documentation states:
"Two adjacent table rows of the same table depth are considered part of the same table unless they differ in one of the following properties:

  • The operand to sprmTIpgp
  • The table style, as specified by sprmTIstd
  • The table directionality as specified by sprmTFBidi or sprmTFBidi90
  • The table position and wrapping as specified by sprmTPc, sprmTFNoAllowOverlap, sprmTDxaAbs, sprmTDyaAbs, sprmTDxaFromText, sprmTDyafromText, sprmTDxaFromTextRight, andsprmTDyaFromTextBottom"

I have discovered that some parameters do not exist, I am unsure how to all compare them.

Is it necessary to compare all these parameters (if exist)?

I sometimes encounter difficulties when the table row contains merged cells, etc.
I have loaded the table parameters (sgc=5), additional parameters in 0x6646 (SprmPHugePapx), as well as the parameters present in the paragraph (sgc=1) 0x646B - sprmPTableProps....

for example:

  1. paragraph - first table (contains 2 textruns "Certification", "\a")
  2. paragraph - first table (contain 1 textrun "\a")
  3. paragraph - next table (contain textrun "MB-400....")
    example_ttp
    Thank you,
    Vlado Popelka
Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
146 questions
{count} votes

Accepted answer
  1. Tom Jebo 2,161 Reputation points Microsoft Employee
    2025-03-21T22:59:14.2833333+00:00

    Hi Vlado,

    From your description, it looks like your question is around comparing the properties of tables to determine if they are two consecutive table that should be considered one table or if they are different tables and therefore have two final rows. Is this correct?

    I have discovered that some parameters do not exist, I am unsure how to all compare them.

    Since properties by definition are defined to be differences from the default formatting for whatever object, in this case a table, if some properties are missing (you had said "parameters"?) then they would be assumed to be the default values. Therefore, you comparing all properties would be possible.

    Is it necessary to compare all these parameters (if exist)?

    Yes.

    I sometimes encounter difficulties when the table row contains merged cells, etc. ...

    For the rest of your question about merged cells, I'm not clear what the problem is here. Can you be more specific about what is wrong with the table rows you are describing there? If you can provide a sample document with that table, it might help also.

    Best regards,
    Tom Jebo
    Microsoft Open Specifications Support

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.