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

[JS] How to create a table in Javascript

New Here ,
Sep 05, 2012 Sep 05, 2012

Hello,

I am French and my English is poor. Sorry in advance if anything is unclear.

I would like to create a table entirely in javascript. An example:

table.jpg

How to make? I not find how to create rows and columns and how to fill cells with text ...

Thanks,

TOPICS
Scripting
3.4K
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 ,
Sep 05, 2012 Sep 05, 2012

You could use the add() method for the Table object and define some properties:

var myTable = myTextFrame.insertionPoints[0].tables.add({columnCount:3,headerRowCount:1,bodyRowCount:1});

If you want to add properties, work on with the "myTable" variable…

For full documentation see:

http://www.jongware.com/idjshelp.html

Uwe

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
Engaged ,
Nov 05, 2016 Nov 05, 2016

// reset the Find/Change dialog

app.findGrepPreferences = app.changeGrepPreferences = null;

// formulate a grep search string

app.findGrepPreferences.findWhat = 'hsm18.+?$';

// find all occurrence, last one first

f = app.activeDocument.findGrep (true);

for (i = 0; i < f.length; i++)

{

// construct file name

name = f.contents.replace (/@/g, '');

// place the pdf and REPLACE the destination with the folder of links

f.insertionPoints[0].place (File ('/Users/f-0262/Desktop/temp/' + name));

}

// delete all @??@ codes

app.activeDocument.changeGrep()

-Sumit
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 ,
Nov 05, 2016 Nov 05, 2016

Hi Oriup,

this thread is about creating tables with ExtendScript.
Not about using GREP Find/Change.

Please add a new thread about your problem with a telling title here in the forum.
And also add a description of what you like to do with some words. What is working and what is not.

Regards,
Uwe

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
Engaged ,
Nov 06, 2016 Nov 06, 2016
LATEST

Hi Laubender,

I am new to forum, I have mistakenly place this code here.

I do not know how to delete.

By the way this code is find text and place image.

Sumit

-Sumit
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