Hello,
To query cell and rows in tables, you need to set the parent option, for example, using the document SimpleExample.docx in the package:
$docx = new CreateDocxFromTemplate('SimpleExample.docx');
$referenceNode = array(
'type' => 'table-cell',
'parent' => 'w:tbl/w:tr/',
'contains' => 'First row',
);
$contents = $docx->getWordStyles($referenceNode);
You can read a sample of getting cell and row information in examples/DocxPath/getWordStyles/sample_7.php
Although First row (as A1 in your DOCX), is included in a paragraph, this paragrah is also include in the cell (w:tc) so the query returns the correct information. Also please note that some styles can be applied to table (w:tbl) or even a custom table style (getWordStyles is compatible with both), so you'd need to query them too depending on how the DOCX was created.
About gettion layout values, you can use Indexer: https://www.phpdocx.com/api-documentation/docxutilities/indexer-parse-word-documents-with-PHP, layout is set in sections.
Regards.