Skip to main content
Participant
June 14, 2022
Question

Table formatting script

  • June 14, 2022
  • 3 replies
  • 726 views

Good day all,

 

Seeing so many helpful people and scripts in this forum, I thought I would ask for help.

 

Where could I find a script that can perform several tasks on a table?

I want the ability to do the following to a/several table(s)

• apply a paragraph style

• apply a table style

• apply a cell style to all cells

then

• apply a cell style to the top row only + align the text to the bottom of the cell

• apply another cell style to the bottom row

 

I would like the ability to

click nowhere and have the script run on the enritre document

click on/in a text box and have the script run on the tables in that text box (and the ones on the following pages)

click on/in a specific table and have the script run only on that table

 

Does such a thing exist?

 

Thank you,

 

Stephane

This topic has been closed for replies.

3 replies

Fred.L
Inspiring
June 15, 2022

Yes, it definitely exists, I frequently use both of them.

Comment from @m1b is also definitely accurate. You need to learn a bit of scripting in order to customize the script and make it work as you want. Not that much complicated when you just have to customize the names though. 

 

Before sharing the script, I would need some answers:
- Are all the table based on the same structure, in terms of number of columns/ rows/ witdth ? 

- Do you use Headers/ Footers ?

 

Best

Fred

m1b
Community Expert
Community Expert
June 15, 2022

Hi @Stephanemaestro, what is your scripting level? Have you made a start? Scripting tables is complicated at first, but when you come to terms with it, you can do a lot. Defnitely everything you ask. Otherwise, we will see if anyone has a ready-made script that might help.

- Mark

Participant
June 15, 2022
Hi Mark,

Thanks for your reply.

I have no scripting experience. Never needed it before, but this new jobs, styles are set and nothing can be modified, so I have to resort to scripts to automate some things.

If something already existed that would be great.

Thanks.

Stéphane
ajabon grinsmith
Community Expert
Community Expert
June 15, 2022

Table style setting items include paragraph styles and cell styles to be applied.
You can also set individual cell styles only for header rows.
Thus, I suspect that applying the table style is all that is needed.

Participant
June 15, 2022
Hello.

Is this was my computer that is exactly what I would do. Sadly I have to use templates already created and we are not allowed to modify anything. My only resort is scripts, otherwise everything has to be done manually one table, column, cell at a time...

Thanks.

Stéphane