XML API - pdx:replaceTableVariable
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createCharacterStyle
- createListStyle
- createParagraphStyle
- docxSettings
- importHeadersAndFooters
- importListStyle
- importStyles
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- addBookmark
- addBreak
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addStructuredDocumentTag
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteBlock
- modifyInputFields
- processTemplate
- rawSearchAndReplace
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
pdx:replaceTableVariable
Replaces a group of variables within a set of table rows (text strings or WordFragments).
Note
You are reading the XML API documentation. For the PHP API method please go to replaceTableVariable.
Description
Element definition
This element is designed to generate a Word table with an, a priori, indetermined number of rows.
If one includes a set of placeholder variables in a set of rows phpdocx wil clone those rows the required number of times and populate the variables with the provided values.
Attributes and sub-elements
variableName
Template variable name. The keys of the associative array should match the names of the variables that you want to replace by their corresponding values.
options
Key | Description |
---|---|
firstMatch | If the variable appears more than once within the Word document and firstMatch is set to true, phpdocx will only replace the first ocurrence of the variable within the Word document. |
target | Possible values are: document (default), header, footer. This option sets the scope of the replacement procedure. |
parseLineBreaks | If true (default is false) parses the line breaks to include them in the Word document. |
type | inline (default) or block; used by WordFragment values. |