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

Contributor ,
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

334

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
Contributor ,
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
Contributor ,
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
Contributor ,
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
Contributor ,
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
Contributor ,
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
Contributor ,
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
Contributor ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

What I want to say is how to achieve:
Do you not need to select the last row,
As long as the cursor is only in the table (or you select the entire table), your operation is for the last 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 23, 2021 Aug 23, 2021

Copy link to clipboard

Copied

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
Contributor ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

How to add a new row at the end of the table and convert it to the "end of the table".
Then, apply the style "tab-foot" cell style to this 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 ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

What do you mean by "end of the table"? If we add the row at the end, is it not already the end of the table, or do you want to do something special with it. Please explain this a bit clearly.

-Manan

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
Contributor ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

for example:
This table originally had 6 rows. Now I want to add a blank row as the table footer.

Snipaste_2021-12-19_21-54-44.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 ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

We went through this ad nauseam in the thread you started entitles "How to implement the footer of the last behavior of a table with a script?". If the solutions offered there don't work for you, please go back to that thread.

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
Contributor ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

The previous posts are getting more and more complicated, and they are not clear.
Maybe I didn’t make it clear, and the answer was not very clear.

 

Maybe you will be very confused.
Why add a blank line? This is to ensure that the long form is at the bottom of each page, and the lines in the form are bold

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
LEGEND ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

Ignoring replies and posting again as if a new question (without a link to the old question), is just about the most disrespectful thing you can do in a forum. I'd be surprised if anyone will now take the time to help. 

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
Contributor ,
Dec 19, 2021 Dec 19, 2021

Copy link to clipboard

Copied

LATEST

Sorry.!
The old posts are a bit messy.
Some are messy, some are unclear.
It feels more and more chaotic..

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