Copy link to clipboard
Copied
Hi,
I am working in financial tables. the tables having alternate row colours.
I have applied cell styles to all table body rows. In additionally i need alternate row colors in all tables, in table style alternate row option not working. but once i remove the cell styles in body rows it will working.
Can any one please give me a solution regarding this issue?
Hi,
I am working in financial tables. i need script for the below requirement. any one suggest.
For all tables from second column onwards ""Tbody_rightalign" paragraph style. and all parenthesis values should be "Tbody_bracket" style, but these changes to be omitted in first rows because column head having separate style.
Copy link to clipboard
Copied
Try this,
var doc = app.activeDocument,
_tables = doc.stories.everyItem().tables.everyItem().getElements();
for(var i =0;i<_tables.length;i++)
{
var _rows = _tables.rows;
for(var j=1;j<_rows.length;j+=2)
{
_rows
.fillColor = doc.colors.item("red"); }
}
Regards,
Chinna
Copy link to clipboard
Copied
I think this is what you want
var doc = app.documents.add(),
tf = doc.pages[0].textFrames.add({
geometricBounds: ["12.7mm", "12.7mm", "100mm", "197.3mm"],
contents: "Head 1\tHead 2\tHead 3\r1a\t1b\t1c\r2a\t2b\t2c\r3a\t3b\t3c\r4a\t4b\t4c\r5a\t5b\t5c"
}),
myTable = tf.texts[0].convertToTable();
myTable.rows[0].rowType = RowTypes.headerRow;
myTable.alternatingFills = AlternatingFillsTypes.alternatingRows;
myTable.startRowFillColor = doc.colors.itemByName("Magenta");
myTable.startRowFillTint = 60;
myTable.endRowFillColor = doc.colors.itemByName("Cyan");
myTable.endRowFillTint = 50;
Trevor
Copy link to clipboard
Copied
P.s. for all the tables etc. use doc = app.activeDocument and myTable(s) = doc.stories.... as per China's example
I was just showing how to do the alternating bit in the snippet above
Copy link to clipboard
Copied
Guys, your scripts produces local overrides.
@VeluVK: I would think, that your cellstyle has a fill applied. In this case the alternating rows from the table style are overwritten by the cellstyle. In a normal world there is no need for a script in this case.
If your cellstyles have no fill, please provide an example file.
– Kai
Copy link to clipboard
Copied
Hi Kai,
Many thanks for your reply.
Cell style fills having "None". but it is not working. when I use the Ignore it will working fine.
Thanks & Regards,
Velu
Copy link to clipboard
Copied
Hi,
I am working in financial tables. i need script for the below requirement. any one suggest.
For all tables from second column onwards ""Tbody_rightalign" paragraph style. and all parenthesis values should be "Tbody_bracket" style, but these changes to be omitted in first rows because column head having separate style.
Copy link to clipboard
Copied
I am working in financial tables. i need script for the below requirement. any one suggest.
For all tables from second column onwards ""Tbody_rightalign" paragraph style. and all parenthesis values should be "Tbody_bracket" style, but these changes to be omitted in first rows because column head having separate style.
Grey should be Tbody_rightalign style.
Pink color should be Tbody_bracket style.
Any one help me pls. i am having 150+ tables.
Thanks,
Velu
Find more inspiration, events, and resources on the new Adobe Community
Explore Now