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

[JS] How to create a table in Javascript

New Here ,
Sep 05, 2012 Sep 05, 2012

Copy link to clipboard

Copied

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

Views

3.1K

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 ,
Sep 05, 2012 Sep 05, 2012

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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