9 Replies Latest reply on Aug 18, 2011 5:59 AM by phyllisj9

    Alternate fill on rows and columns - Mixing it together. How?

    ricbuchner

      Hi,

      I don't know how to explain this in english, so I will post an image to better illustrate it:

      example.jpg

       

      I know how to alternate the fill color if the whole table is a 2-colors only. I just can't do it on separate columns as showed above.

      Is there a way of doing it, instead of manually select each cell and pick the color for it?

       

      Thanks!

        • 1. Re: Alternate fill on rows and columns - Mixing it together. How?
          phyllisj9 Level 2

          I can't think of any way to do that automatically (though I might be wrong).  You can make alternating row fills with black (so that it comes out grey) and then place a transparent colored block over each column to change its color (faster than changing all the cells!).

           

          I'd love to know if there's a better way to do that though.  It does look nice.

           

          Thanks, Phyllis

          • 2. Re: Alternate fill on rows and columns - Mixing it together. How?
            phyllisj9 Level 2

            Actually that doesn't work -- the transparent block obscures the text in the table.  I then thought perhaps you could put the block behind the table, but it doesn't look like you can make a table with alternating row fills transparent (without also making the text transparent).

             

            Sorry.  :-(

            • 3. Re: Alternate fill on rows and columns - Mixing it together. How?
              Joel Cherney Adobe Community Professional & MVP

              I know how to alternate the fill color if the whole table is a 2-colors only. I just can't do it on separate columns as showed above.

              Is there a way of doing it, instead of manually select each cell and pick the color for it?

               

              Well, you could make some cell styles; that would let you manually select three whole cells! at once, and you'd only need to pick the color once for each style. It'd save you some mousework, at least.

              • 4. Re: Alternate fill on rows and columns - Mixing it together. How?
                phyllisj9 Level 2

                I wonder:  It might actually be faster to do what I originally thought (an alternating black row covered with a transparent colored block).  Make an empty table with those effects (row fill + color blocks) and then layer another table containing just the content (the type) on top of it.

                 

                Annoying to have 2 tables on top of each other but probably faster than doing selections of individual cells....

                • 5. Re: Alternate fill on rows and columns - Mixing it together. How?
                  phyllisj9 Level 2

                  Yeah I just tried that, and it's quite fast and easy to expand.  Just if you're passing the file off to someone else you'd want to leave some notes about how that's constructed....

                  • 6. Re: Alternate fill on rows and columns - Mixing it together. How?
                    Peter Spier Most Valuable Participant (Moderator)

                    I avoid tables as much as possible, but was wondering if maybe splitting this into four tables would work.

                    • 7. Re: Alternate fill on rows and columns - Mixing it together. How?
                      [Jongware] Most Valuable Participant

                      I could whip up a script that'd do this in a jiff, but hey, since I'm an arrogant git I won't.

                      • 8. Re: Alternate fill on rows and columns - Mixing it together. How?
                        [Jongware] Most Valuable Participant

                        Or perhaps I will -- here's a Javascript for you. Fill in your SWATCH NAMES in the Horizontal list, and TINTS in the Vertical list. You don't need to make sure you 'use' all columns, they will automatically wrap around (i.e., you could make do with only one swatch name and one tint value, and you'd get all of your table filled with the same color and tint).

                         

                        if (app.documents.length > 0 && app.selection.length == 1 && (app.selection[0].parent instanceof Cell || app.selection[0] instanceof Column || app.selection[0] instanceof Cell || app.selection[0] instanceof Row || app.selection[0] instanceof Table))
                        {
                             table = app.selection[0];
                             if (!(table instanceof Table))
                                  table = table.parent;
                             if (!(table instanceof Table))
                                  table = table.parent;
                             doThatTableOnemoreTime(table);
                        } else
                             alert ("Out of Cheese Error! Re-do from start");
                        
                        function doThatTableOnemoreTime (onTable)
                        {
                             var swatchListHorizontal = [
                                  "C=100 M=0 Y=0 K=0",
                                  "C=100 M=0 Y=0 K=0",
                                  "C=15 M=100 Y=100 K=0",
                                  "C=15 M=100 Y=100 K=0",
                                  "C=15 M=100 Y=100 K=0",
                                  "C=0 M=0 Y=100 K=0",
                                  "C=0 M=0 Y=100 K=0",
                                  "C=100 M=0 Y=0 K=0"
                             ];
                             var tintsVertical = [
                                  100,
                                  50
                             ];
                             
                             for (y=0; y<onTable.rows.length; y++)
                             {
                                  for (x=0; x<onTable.rows[y].cells.length; x++)
                                  {
                                       onTable.rows[y].cells[x].fillColor = app.activeDocument.swatches.item(swatchListHorizontal[x % swatchListHorizontal.length]);
                                       onTable.rows[y].cells[x].fillTint = tintsVertical[y % tintsVertical.length];
                                  }
                             }
                        }
                         
                        

                        • 9. Re: Alternate fill on rows and columns - Mixing it together. How?
                          phyllisj9 Level 2

                          Jongware, you are too cool. :-)  I'm not the OP, but I'll definitely play around with your script since I like that effect. Thanks for everything you contribute to this board!

                           

                          Phyllis