Skip to main content
Known Participant
May 20, 2019
Answered

Different text style in every second cell

  • May 20, 2019
  • 4 replies
  • 1847 views

Hello everyone,

is there any way to change tables text formatting in every second cell?

I have a table with 100 cells and 1 column. I want to change every second cells text formating (font family, font size and font colour).

I know it is possible to change every second cell style but i can't find similar solution for text formatting in every second cell.

Do you have any idea how I can do it?

This topic has been closed for replies.
Correct answer FRIdNGE

Jose,

I only come back here to post this and give you the most simplistic way to fix your issue [in bold below]!

• You have a table as you said [It could a basic table].

• Create (if not already done) 2 cell styles you could call "Title" (including the grey background and the "Title" para style) and "Description" (including the white (or no) background and the "Description" para style).

[Link the 2 para styles has no interest.]

• Just apply (manually) the cell style "Title" to the first cell of the table.

• Just apply (manually) the cell style "Description" to the second cell of the table.

Normally, all I previously mentioned has already be done by you when you posted your question!!

So, now, you just needed to do this:

Select these 2 first cells … and play this script!

Dropbox - FRIdNGE-0499_TableCellStyles.jsxbin - Simplify your life

Done! The cell styles have been alternatively applied to all the cells!

Have a good day! … and next time, read your Adobe private messages!

Best,

Michel, for FRIdNGE

4 replies

Community Expert
May 20, 2019

Based on your screen shot example, you could try formatting text first, with a next style (title > next style description, description > next style title) and then convert to a table and apply a table style with alternating rows.

Peter Villevoye
Community Expert
Community Expert
May 20, 2019

Oooh, that's a nice example of out-of-the-box/cell/table thinking !

Peter Villevoye
Community Expert
Community Expert
May 20, 2019

Try Smart Styles - a plugin from WoodWing.

You can give the trial a free spin for a whole month.

I'm not sure if it will be able to set and apply alternating text formatting or styles – that would be the easiest and best solution ! But if it doesn't work that way, then maybe you can painstakingly set up one proper example, grab the style of it, and hope it will retain the alternating effect when applying it to another table.

Community Expert
May 20, 2019

Hi Peter,

SmartStyles is indeed able to detect a design pattern like the use of alternating formats in cells.

So yes, this is really worth testing.

A small sample of a table as template is enough so that SmartStyles will be able to analyze the pattern.

And if that saved smart style will be applied to a different table the styles will be applied like the analyzed template.

Just like the sample is doing this.

Regards,
Uwe

winterm
Legend
May 20, 2019

Worked with WoodWing Smart Styles plugin in the early days of ID v.3 (CS) and was really impressed by its ability to catch quite complex patterns. The only drawback - it's cooostly, and, unless you're dealing with tables every day, you may have a hard time to justify the purchase to your boss or your own wallet.

On the other hand, it is applicable not only to tables…

Why oh why Adobe couldn't buy it and include in, say, version 15.

Legend
May 20, 2019

https://forums.adobe.com/people/Jose+Arcadio  wrote

I know it is possible to change every second cell style but i can't find similar solution for text formatting in every second cell.

Cell styles can contain paragraph styles, so applying alternating cell styles is the way to apply alternating text formatting,

Known Participant
May 20, 2019

SJRiegel​ yes but it doesn't work for every second cell. Your solution works globaly for whole table.

Legend
May 20, 2019

https://forums.adobe.com/people/Jose+Arcadio  wrote

SJRiegel  yes but it doesn't work for every second cell. Your solution works globaly for whole table.

I see. You said you had a way of alternating cell styles, but I think you must have meant alternating fills.

A table option for alternating cell styles would be a great feature request.

winterm
Legend
May 20, 2019

In case your longest Title is still shorter then the shortest Example Text, it is doable with GREP.

1. Apply Example Text para style to the whole table.

2. Use this GREP query ^.{1,20}$ to locate any paragraph ranging from 1 to 20 characters long, and apply Title style to it. Sure, you can use any number instead of 20, which fits your threshold.

Known Participant
May 20, 2019

winterm​ thank you. Unfortunately sometimes Title is longer then Example Text.

So your solution won't work.

winterm
Legend
May 20, 2019

OK, amount of characters was just the first thing to try, since titles usually are shorter then descriptions. Well, not always.

What else you can say about your text, how machine could tell title from description? Maybe there's always a certain number(s), or any punctuation, or words in ALL CAPS somewhere in descriptions, but never - in titles? (Almost) anything can be used. Could you say about something: this is always found in Titles, but never - in Descriptions, or vice versa.