• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
11

How to place a border at the end of a table for a file with hundreds of tables?

Engaged ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

Tried to use the border menu at table set but only is allowed check all 4 sides.

Screenshot 2024-01-30 at 11.08.42 AM.png
****************
Or at least how to apply to the last row a style (in fact my tables have an empty last row not styled...) since the table configuration does not label it automatically?

Screenshot 2024-01-30 at 11.09.27 AM.png

TOPICS
How to , Scripting

Views

318

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

Community Expert , Jan 30, 2024 Jan 30, 2024

@palala fog 

 

main();
function main(){
	var myTables = app.selection[0].tables.everyItem().getElements();
	for (var i=0; i<myTables.length;i++)
	{
		myTables[i].bottomBorderStrokeWeight = "1mm";
	};
}

 

This will process ONLY selection - so in order to process whole Story - you need to select all the Text in the Story.

Selecting only one TextFrame - will process only Tables in this TextFrame.

If you select only few Paragraphs in the Text - only Tables in the Selection will get processed.

If yo

...

Votes

Translate

Translate
Guide , Jan 31, 2024 Jan 31, 2024
app.activeDocument.stories.everyItem().tables.everyItem().bottomBorderStrokeWeight = "4mm";

 

(^/)

Votes

Translate

Translate
Guide ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

Can you show us a sample-table?

 

(^/)  The Jedi

Votes

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
Community Expert ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

  • Create a Cell Style with the bottom border you want.
  • Define your Table Style to have 1 Footer row.
  • In Table Style Options, assign your Cell Style to the Footer row.

 

Some tweaking may be needed to get a footer row only where you want it, but that sequence should do it.

 

This is a Cell Style named 'Footy,' applied in Table Style Options to the Footer row of Table Style 'Footed':

JamesGiffordNitroPress_0-1706634046616.png

 

 


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

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
Community Expert ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

@James Gifford—NitroPress 

 

Where in the Table STYLE can you define number of Header/Footer rows??

You can only assign CellStyle - but you can't define how many rows there will be...

 

OP have 100s of tables - and this can only be done in the Table Options - for each table individually - and increasing number of Header / Footer rows - results in InDesgin ADDING - not converting existing - rows...

 

Unless I'm missing something?

 

Votes

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
Community Expert ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

Ah... oops. Didn't realize headers/footers were not a style component. Setting tables up involves so many cross-connecting menus... 😛


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

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
Engaged ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

Robert, quite perfect. It worked very good.

Thanks for your time and the rest of information.

Just to know: it is possible to select all tabls in a file?
Best regards.

Votes

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
Community Expert ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

@palala fog

 

You are welcome. 

 

Yes, it's possible to select whole Table - it's trivial - but what do you want to do next? 

 

Votes

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
Community Expert ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

@palala fog 

 

main();
function main(){
	var myTables = app.selection[0].tables.everyItem().getElements();
	for (var i=0; i<myTables.length;i++)
	{
		myTables[i].bottomBorderStrokeWeight = "1mm";
	};
}

 

This will process ONLY selection - so in order to process whole Story - you need to select all the Text in the Story.

Selecting only one TextFrame - will process only Tables in this TextFrame.

If you select only few Paragraphs in the Text - only Tables in the Selection will get processed.

If you have Tables in separte Stories - then this code would have to be modified.

 

There are more setting you can change:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Table.html

RobertTkaczyk_1-1706635177706.png

 

Same with Left, Right & Top edges.

 

Votes

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
Guide ,
Jan 31, 2024 Jan 31, 2024

Copy link to clipboard

Copied

app.activeDocument.stories.everyItem().tables.everyItem().bottomBorderStrokeWeight = "4mm";

 

(^/)

Votes

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
Community Expert ,
Jan 31, 2024 Jan 31, 2024

Copy link to clipboard

Copied

LATEST
quote
app.activeDocument.stories.everyItem().tables.everyItem().bottomBorderStrokeWeight = "4mm";

 

By @FRIdNGE

 

Yeah, I was trying this as well - but for some reason, it wasn't working for me - but I'm not JS guy. 

 

Votes

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