Forum


Replies: 1   Views: 101
How to remove specific table cell? or table row?

Posted by fairshareitservices  · 08-04-2024 - 11:01

We are using below code to remove a specific table on condition. But we want to remove only the cell that contain 'Regular' text. Instead of removing complete table from document need to delete specific row or cell. 

if($placeHolderName == 'tracking_error_regular')
        {
        $templateDocx->removeTableRowByTemplateVariable($placeHolderName);
        $referenceNode = array(
            'type' => 'table',
            'contains' => 'TRACKING ERROR',
        );
        $templateDocx->removeWordContent($referenceNode);
        mLog("Removed table for tracking_error_regular of $schemeCode");
        return $templateDocx;
        }