Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to implement the footer of the last behavior of a table with a script?

Participant ,
Aug 15, 2021 Aug 15, 2021

Copy link to clipboard

Copied

I need to set the last row of the table to be gross, and set the row height to 0.1mm.

At the same time, I want to set the bottom cell line to 0.3mm.

 

I hope some experts can help me realize it with scripts.

Sometimes the row height is too small to be selected manually.

Thank you.

TOPICS
Activation billing and install, Bug, How to, Import and export, Performance, Scripting, Server developers

Views

165

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Adobe Community Professional , Aug 15, 2021 Aug 15, 2021
Rows must be at leat 3 pts (or 1.058 mm) high. So there's a problem.. P.

Likes

Translate

Translate
Adobe Community Professional , Aug 15, 2021 Aug 15, 2021
Create a custom stroke in the stroke panel and choose that stroke.

Likes

Translate

Translate
Participant ,
Aug 15, 2021 Aug 15, 2021

Copy link to clipboard

Copied

Like this

6601.jpg

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 15, 2021 Aug 15, 2021

Copy link to clipboard

Copied

Rows must be at leat 3 pts (or 1.058 mm) high. So there's a problem..

P.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 15, 2021 Aug 15, 2021

Copy link to clipboard

Copied

Create a custom stroke in the stroke panel and choose that stroke.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 16, 2021 Aug 16, 2021

Copy link to clipboard

Copied

Hi dublove,

suggestion to overcome a possible minimum row height issue:

Plan with a table 10 times the size you need it.

 

Scale the frame that holds the table to 10% with InDesign's preferences set to:

General > Object Editing > [x] Adjust Scaling Percentage

 

ScalingFrameOfTable-EffectiveHeight-2.PNG

 

Effective height of the bottom stroke is 0.3 mm:

ScalingFrameOfTable-EffectiveHeight-1.PNG

 

Table row selected in scaled text frame:

ScalingFrameOfTable-EffectiveHeight-3.PNG

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 16, 2021 Aug 16, 2021

Copy link to clipboard

Copied

Clever! But planning a table 10 times its desired size is not so simple. Why not take an existing table, resize it 1000%, then add the last row, and resize 10%?

P.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 21, 2021 Aug 21, 2021

Copy link to clipboard

Copied

Hi~Peter Kahrel

How to implement it? There is no need to select rows

Just place the cursor in the table or select all tables,

You can operate on the last table row

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

Not sure I understand your question. It seems to me that you're looking for someone to write a script for you. Is that correct?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

No one has written it for me. I met it in the process of using it.

In this post, laubender helped write a paragraph, but he (she) didn't seem to fully understand my problem.

He or she needs to select the last table row,

I think if only the cursor in the table can determine the last table row.

I also want to be able to control the topinsede of the last table row It's empty. That script doesn't seem to work.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Hi dublove,

if I look at your screenshot there is a gap, that 0.1 mm, in the cells of your footer row.

 

OP-6601.jpg

 

Can I interpret this like I do in my screenshot below?

 

RowHeight-0.3mm-gap-0.1mm-TopStroke-0.1mm-BottomStroke-0.3mm.PNG

If yes it can be done by scripting.

When the footer row is the target ( or selected ) and the top stroke weight for all cells in the footer row is 0.1 mm:

 

//Select the table's footer row:
var myRow = app.selection[0];

// Optional:
myRow.cells.everyItem().contents = "";

// Not optional. 
// Set the point size in a value, so that the text could be visible despite the minimal height of the cells:
myRow.cells.everyItem().texts.everyItem().pointSize = 0.1;

myRow.cells.everyItem().topInset = 0;
myRow.cells.everyItem().bottomInset = 0;
myRow.cells.everyItem().height = "0.3 mm";

 

Regards,
Uwe Laubender

( ACP )

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 21, 2021 Aug 21, 2021

Copy link to clipboard

Copied

How to implement it? There is no need to select rows

Just place the cursor in the table or select all tables,

You can operate on the last table row

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

An explanation:

I digged out one of my code snippets from 2015. See the related discussion:

 

Making a row smaller then 1,058mm?
blackbookeditora, Jun 30, 2015

https://community.adobe.com/t5/indesign/making-a-row-smaller-then-1-058mm/m-p/7275023

 

Also this related one from the same OP:

 

I need to force column widths to values smaller than the indesign preset minimuns (1,058mm).
blackbookeditora, May 13, 2014
https://community.adobe.com/t5/indesign/i-need-to-force-column-widths-to-values-smaller-than-the-ind...

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

Can I automatically identify the last line.

Select all tables or place the cursor in the table.

Also, I need to set the thickness of the bottom border of the last row to 0.3mm

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

If you have one single footer row it's:

table.rows[-1]

 

For properties of cells look up DOM documentation:

https://www.indesignjs.de/extendscriptAPI/indesign16/#Cell.html

 

Also:

https://www.indesignjs.de/extendscriptAPI/indesign16/#Table.html

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 19, 2021 Aug 19, 2021

Copy link to clipboard

Copied

Sad, I don't know how to start……

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 23, 2021 Aug 23, 2021

Copy link to clipboard

Copied

LATEST

Hi dublove,

how are your scripting skills?

Did you ever write a script from a to z for InDesign?

 

You say: "I need to set the last row of the table…"

How would you like to identify the table in the document?

Is it the only one? Would you like to select the table?

 

If it is only one table make sure the table has one single footer row that you can use for the design you outlined in your screenshot. Or do you like to add quite another footer row for that purpose?

 

If my code did not work for you: Please provide a sample document with the table where the code did not work.

Put the document on Dropbox or a similar service and post the download link.

 

Thanks,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines