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

Ask for help with a complete auto-form script.

Guide ,
Aug 15, 2024 Aug 15, 2024

I've asked you before, but it's a bit sporadic.

This feature should be used by many people.

 

Apply table style first: mytab.

 

Then cell style:
Table body: set the minimum row height to 7mm.

 

The end of the table(tab footer?):

first judge the last line, if it is a blank line, straight should be set as the end of the table line, apply footer cell style, and go to the end of the table.
If the last line is not empty, then add a new line as the end of the table.
Set the exact line height is: 1.058mm.

 

Table header:

it is generally believed that there is only one line of table header.
Copy a line of the table header, at the same time in the first new line of blank lines, horizontal merge cells, fill in the ‘continuation of the table’ two words, and apply the ‘continuation of the table’ cell style.
The first two rows will be transferred to the header row, and skip the header.
Set the exact row height: 5mm;

 

Thank you very very very much.

 

auto table.jpg

 

 

 

 

TOPICS
Bug , Feature request , How to , Performance , Scripting
240
Translate
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 ,
Aug 15, 2024 Aug 15, 2024

Cellstyles do not have the ability to set a height directly; but you can set it indirectly. It would be whatever the paragraph style point size and leading of the text are plus whatever amount of cellpadding you add to the cell style.

To make the first row be a header row (which automatically repeats at the top of each page or column), select the first row and assign it as Table > Convert Rows > To Header.

Continuations can be built by choosing Type > Insert Special Characters >  Markers > Next or Previous Page Number

Read about Story Jumps:

https://helpx.adobe.com/indesign/using/numbering-pages-chapters-sections.html

Mike Witherell
Translate
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 ,
Aug 15, 2024 Aug 15, 2024

@m1b 

Great m1b, requesting attention, please.

Translate
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 ,
Aug 16, 2024 Aug 16, 2024
LATEST

I found what I asked before.It was answered by Eugene Tyson at the time.

A little more refinement would be nice.

Also exists across rows and columns, there will be an error

 

How do I get the cursor to be in the table without having to select the whole table?

Automatically copy the first header row, then add a new row and fill it with ‘Continued Table’.
Finally, transfer the first two rows to the header row and hide them.

668.jpg

 

var table = app.selection[0];
table.appliedTableStyle = "mytab";
var myHeaderRow = table.rows[0];
var myFooterRow = table.rows[-1];

// Convert first row to header and apply cell style
myHeaderRow.cells.everyItem().appliedCellStyle = "header";
if (myHeaderRow.rowType !== RowTypes.HEADER_ROW) {
    myHeaderRow.rowType = RowTypes.HEADER_ROW;
}

// Check if the last row is empty
var isLastRowEmpty = true;
for (var j = 0; j < myFooterRow.cells.length; j++) {
    if (myFooterRow.cells[j].contents !== "") {
        isLastRowEmpty = false;
        break;
    }
}

// If the last row is not empty, add a new row for the footer
if (!isLastRowEmpty) {
    table.rows.add();
    myFooterRow = table.rows[-1];
}

// Convert the last row to footer and apply cell style
myFooterRow.cells.everyItem().contents = "";
myFooterRow.cells.everyItem().texts.everyItem().pointSize = 0.1;
myFooterRow.cells.everyItem().appliedCellStyle = "footer";
myFooterRow.cells.everyItem().topInset = 0;
myFooterRow.cells.everyItem().leftInset = 0;
myFooterRow.cells.everyItem().bottomInset = 0;
myFooterRow.cells.everyItem().rightInset = 0;
myFooterRow.cells.everyItem().height = "1.06mm";

if (myFooterRow.rowType !== RowTypes.FOOTER_ROW) {
    myFooterRow.rowType = RowTypes.FOOTER_ROW;
}

// Set the minimum height for all rows except the last one
for (var i = 0; i < table.rows.length - 1; i++) {
    table.rows[i].cells.everyItem().minimumHeight = "7.6mm";
}

 

 

Translate
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