7 Replies Latest reply on Jan 19, 2012 6:30 AM by Eugene Tyson

    Problem with nested styles in a table

    codemonkey76

      I am trying to create a table with every second line Bold, there doesn't seem to be a way to set alternating styles on the text, only on the stroke / fill. I thought as a work around I could have the 2 lines of text in each row, so I could then use a paragraph style with nested style to specify the first line bold and the second line not bold, But, although this works on a standard text frame, it doesn't work in a table. Does anyone know how I can achieve this?

       

      e.g.

       

      Some Heading
      Product Code
      Description
      Product Code
      Description

       

      p.s. I don't want the lines between product code and description

        • 1. Re: Problem with nested styles in a table
          Joel Cherney Adobe Community Professional & MVP

          Well, if there are lines between Product Code and Description, then they're in different cells, thus in different paragraphs, thus nested styles will never work for your intended purpose. Can you post a screenshot of what you're working on, instead of an example? Because it should be pretty straightforward... if Product Code and Description are in the same cell, and separated by a soft return, or some other nested-style-trigger.

          • 2. Re: Problem with nested styles in a table
            codemonkey76 Level 1

            Capture.PNG

             

            This was originally created as individual text boxes in CorelDraw and I am trying to recreate it as one Table in InDesign.

            • 3. Re: Problem with nested styles in a table
              Eugene Tyson Adobe Community Professional & MVP

              Nested Styles won't work here - but GREP style would

               

              In the Paragraph style set it all to Roman (regular)

               

              Then in the GREP section of the Paragraph style include:

               

              Character style = Table Text Bold

              .+?\-.+

               

              Untitled-1.png

               

              Then whenever you use the Style - Table Text

               

              Any time it encounters text written with a hyphen between them - it will make them bold.

               

              Notice I used a new style called Table Text Bold - so not to be confused with Bold if you already have it in your document.

              • 4. Re: Problem with nested styles in a table
                Peter Spier Most Valuable Participant (Moderator)

                I hate tables, but Id' set it up with each paragraph in its own cell and create cell styles to contol both rules and the paragraph styles.

                • 5. Re: Problem with nested styles in a table
                  Eugene Tyson Adobe Community Professional & MVP

                  No reason a GREP style can't work though. One piece of text is in Roman and the other in Bold.

                   

                  Set the GREP to find one set of either Roman or Bold.

                   

                  You do it the opposite way too.

                   

                  Set all text to Paragraph Style with Bold formatting.

                   

                  Then Set the GREP style to change the

                   

                  \d+pcs

                   

                  to

                   

                  Character Style

                  Table Text Roman (creating a style)

                   

                   

                  Select all the Text - apply the same paragraph style. The GREP style picks up the pieces that you ask to change.

                  • 6. Re: Problem with nested styles in a table
                    Peter Spier Most Valuable Participant (Moderator)

                    My only complaint about GREP styles is they tend to slow performance, and you need to be pretty careful about style definition in general when you use them. There are certainly times when they are the best or even only solution, and they would work here, no doubt, as long as the text maintains the current pattern, but if the pattern of the text should change someplace in the table you'd need to add yet another GREP style, where my method would continue to blindly apply the formatting specified as the base for the paragraph style while not needing to do anything special to alter the look of one line.

                    • 7. Re: Problem with nested styles in a table
                      Eugene Tyson Adobe Community Professional & MVP

                      I can only go on the sample provided. If it's not the same format throughout then it won't work.