Skip to main content
Inspiring
November 13, 2014
Question

column heads

  • November 13, 2014
  • 1 reply
  • 431 views

Hi,

I need  the below requirement:

In all tables, some times there are more than one 'column heading' occurs. I need all Column heads should be a separate cell style.

I have put one empty row, once the column heads ending. (ex: first empty row is the identifier for column heads)

Script need for all the tables in a document.

1) Before the 'first empty row' cells should be a "TCH" cell Style.

2) Remaining row cells should be "Tbody" cell Style (except last row)

3) Table last row should be a "Tbody_last"

4) Based on the number of column heads table styles need to apply.

     if only one column head in a table, it should be "Table style 1" table style

     Two column heads in a table, it should be"Table style 2" table style

     Three column heads in a table, it should be "Table style 3" table style,  etc...

Regards,

Velu

This topic has been closed for replies.

1 reply

hurix
Inspiring
November 14, 2014

Velu

try this:

myTable = app.activeDocument.stories.everyItem().tables;

For look..... n=0;

myActiveTable = myTable;

myActiveTable.rows.itemByRange(0, -2).cells.everyItem().appliedCellStyle = "Tbody"

myActiveTable.rows[0].cells.everyItem().appliedCellStyle = "TCH"

myActiveTable.rows.itemByRange(-2, -1).cells.everyItem().appliedCellStyle = "Tbody_last"

Ram