Skip to main content
Inspiring
January 5, 2021
Answered

It is possible to add one row or a line of text at the end of a table in a document with many table?

  • January 5, 2021
  • 2 replies
  • 861 views

Or at least know the code to look at the end of a table and insert a line of text?

 

Thanks

This topic has been closed for replies.
Correct answer Manan Joshi

Try the following

app.documents[0].stories.everyItem().tables.everyItem().rows.add(LocationOptions.AT_END).cells.everyItem().appliedCellStyle = "StyleName"

-Manan

 

2 replies

Community Expert
January 6, 2021

See if the following script works

app.documents[0].stories.everyItem().tables.everyItem().rows.add(LocationOptions.AT_END)

-Manan

-Manan
Inspiring
January 6, 2021

Fine! It worked.

Just an adenda:
it is possible to assign a ‘cell style’

 

Thanks for your time and reply.

 

Assign «Correct answer» is not working wityh this message:


I will try later:

Manan JoshiCommunity ExpertCorrect answer
Community Expert
January 7, 2021

Try the following

app.documents[0].stories.everyItem().tables.everyItem().rows.add(LocationOptions.AT_END).cells.everyItem().appliedCellStyle = "StyleName"

-Manan

 

-Manan
Community Expert
January 5, 2021

Can you elaborate a bit more, some screenshots might help to understand what you have and what you need. Also, is this is a scripting question(as you mentioned code)

-Manan

-Manan
Inspiring
January 5, 2021

Manan, thanks.
The idea is to introduce the source for these tables and find a way like insert a new row.

Legend
January 5, 2021

You could have this be a row at the bottom of each table, and remove the strokes from the bottom, sides and middle of just that row.