Hi @Mariana TF, I think this would best be explained with code. Please have a look at this, and see what you think. If you are new to coding, it may help to do some tutorials on "for loops". Special methods such as "everyItem" and "getElements" are specific to Indesign, so you will need to look those up in that context. Let me know how you go.
- Mark
/**
* Demonstration of working with specific columns/cells.
* Here we target the body cells from specific columns of every table.
* @author m1b
* @discussion https://community.adobe.com/t5/indesign-discussions/how-to-select-columns-and-rows-non-sequentially/m-p/14440216
*/
function main() {
var doc = app.activeDocument;
// make a place to store the cells
var myCells = [];
// get all the tables from document, as array
var tables = doc.stories.everyItem().tables.everyItem().getElements();
// collect cells from the 3rd, 5th and 7th column from each table
for (var i = 0; i < tables.length; i++) {
myCells = myCells
.concat(tables[i].columns[2].cells.everyItem().getElements())
.concat(tables[i].columns[4].cells.everyItem().getElements())
.concat(tables[i].columns[6].cells.everyItem().getElements());
}
// for each collected cell, check if it is
// a body row, and set the paragraph style
for (var i = 0; i < myCells.length; i++) {
if (RowTypes.BODY_ROW === myCells[i].rowType)
myCells[i].cells.everyItem().texts[0].appliedParagraphStyle = "Right";
}
};
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Set table column style');