8 Replies Latest reply on Nov 27, 2012 3:22 PM by Aaron Johns

    Can this be done with table styles?

    Aaron Johns Level 1

      Hello,

       

      Can someone tell me if this table layout is possible to achieve with table styles? Specifically the first column being slightly darker is proving a problem with the alternating rows, I feel like I need a 'column style' option but there isn't one (in CS5) that I can see. Thanks very much.

       

      Screen shot 2012-11-27 at 4.53.11 PM.png

        • 1. Re: Can this be done with table styles?
          Eugene Tyson Adobe Community Professional & MVP

          Not that I can figure out...

           

          There might be a plugin or script for this but I've not come across any.

           

          Perhaps you should ask on the scripting forum?

          1 person found this helpful
          • 2. Re: Can this be done with table styles?
            MW Design Level 4

            Not as a table style--would be nice, though. You probably know you can use cell styles to override the color. Kind of tedious if you have a ton of tables, though.

             

            Take care, Mike

             

            table_styles2.jpg

            1 person found this helpful
            • 3. Re: Can this be done with table styles?
              MW Design Level 4

              In thinking about a scripting solution, one might be able to write the script where one highlights the left column and the script applies appropriate cell styles to every other row. Or, the entire left column is hit but the header row skipped.

               

              Take care, Mike

              1 person found this helpful
              • 4. Re: Can this be done with table styles?
                Laubender Adobe Community Professional & MVP

                @Mike – if you think in scripting this, I would totally avoid  using Table Styles.

                Instead *only* using Cell Styles. If the logic of applying Cell Styles is clear – and I think in this case it is – one can write a script that can do that, independent how many rows or columns are present.

                 

                On the other hand, you could use a PlugIn e.g. from Woodwing, SmartStyles, that could save the table logic as a Library element, that  could be applied to a table.

                 

                What is also possible (without scripting or buying a plug-in):
                Format a table in advance. This is done in a few minutes. You do not need cell styles for that.
                Then copy/paste the contents over the clipboard from Excel to InDesign when  the table is selected.

                 

                Uwe

                1 person found this helpful
                • 5. Re: Can this be done with table styles?
                  Laubender Adobe Community Professional & MVP

                  To elaborate on my last statement:

                  If you do not have the contents of the table available in Excel, just select the table in InDesign, copy/paste to your text editor (it is alright to use TextEdit on a Mac), and then copy/paste the text from TextEdit on to *one* cell in Excel. Excel is smart enough to built a table with the right contents in the right order.

                   

                  Then do your formatting of the table in InDesign:
                  copy/paste rows as much you like, so that you have a really large table (in the moment with the wrong contents).

                   

                  After that select the Excel table and copy/paste the contents to your selected InDesign table.
                  The formatting of the text will be that of your pre-defined InDesign table cells.

                   

                  Uwe

                  • 6. Re: Can this be done with table styles?
                    [Jongware] Most Valuable Participant

                    Sans cell styles, this Javascript adds 20% to the tint of cells in the very first column for each table. It does not change header rows (and on 2nd thought, maybe it shouldn't do footer rows either).

                     

                    .. Without trying, I couldn't tell what happens with complickated merged cells. The document I'm working on contains 8 tables, but the idiotic author pasted them as figures into Word. All of my scripting prowess can't work around that ...

                     

                    tables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
                    for (t=0; t<tables.length; t++)
                    processTable (tables[t]);
                    function processTable (table)
                    {
                    var i, cells = table.columns[0].cells;
                    for (i=table.headerRowCount; i<cells.length; i++)
                    {
                      cells[i].fillTint += 20; // percentage to add
                    }
                    }
                    
                    • 7. Re: Can this be done with table styles?
                      MW Design Level 4

                      Awesome. I'll have a play with the script later when I come up for air.

                       

                      Thank you--Mike

                      • 8. Re: Can this be done with table styles?
                        Aaron Johns Level 1

                        Thanks so much all, thought it was a longshot but that scripting solution works a treat. I'm doing about 40 pages worth of these tables so that's going to save a heap of time. Thanks again.