Copy link to clipboard
Copied
Hi EveryOne!
I am the new baby to this indesign forums. I need apply XML tag to each and every table columns (name likely test1,test2...)
Please help me out this problem or kindly correct my codes.
-yajiviki
My code.
var docRef=app.activeDocument;
var ColLen=app.activeDocument.stories.everyItem().tables.everyItem().columns.length;
for(i=0; i<ColLen; i++){
var mySel=app.activeDocument.stories.everyItem().tables.everyItem().columns;
app.activeDocument.xmlElements[0].xmlElements.add({markupTag:"Test"+(i+1), xmlContent:mySel});
}
Hi,
You can easily tag the table at first with the autoTag command.
myTable.autoTag();
Once that done, you can target the columns cells and reset the applied tag:
var xes = myTable.columns[0].cells.everyItem().associatedXMLElement;
var n = xes.length;
while ( n-- ) xes
.markupTag = "foo"
HTH
Loic
Copy link to clipboard
Copied
Hi,
You can easily tag the table at first with the autoTag command.
myTable.autoTag();
Once that done, you can target the columns cells and reset the applied tag:
var xes = myTable.columns[0].cells.everyItem().associatedXMLElement;
var n = xes.length;
while ( n-- ) xes
.markupTag = "foo"
HTH
Loic