Skip to main content
Daniiiel
Participating Frequently
January 29, 2019
Question

Help applying cell style in table based on list of words

  • January 29, 2019
  • 1 reply
  • 1298 views

Hi all,

I'm an absolute beginner so apologies if this has been answered before, I couldn't find an exact solution for my problem.

I need to apply a cell style to certain cells where varying words appear in a table. It would be awesome if I could merge the row that the words appear in too, but that is a bonus for now.

I found this: How to apply a table cell style based on grep search?

Which works great, but instead of just applying the style to the word 'Banana', I need to apply it to a bunch of other words, for example 'Apple', 'Pear', etc.

Any help would be massively appreciated.

Thank you!

This topic has been closed for replies.

1 reply

Inspiring
January 29, 2019

Hi,

     Need to apply whole paragraphs or specific words inside the cells? U can use paragraphs or words. can you provide any samples with screenshots?

Daniiiel
DaniiielAuthor
Participating Frequently
January 29, 2019

Hi, just whatever is in the cell, it is usually just one or two words.

Inspiring
January 29, 2019

try this.

var myDoc = app.activeDocument;

var tab = myDoc.stories.everyItem().tables[0];

tab.cells.everyItem().appliedCellStyle = "Style1"