Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Paragraph Shading with Tables

Return to Member Forum

  • Author
    Posts
    • #95159
      Ronald Cox
      Member

      I’m trying to find a solution to paragraph shading with tables. I have a section of text, Examples, that has paragraph shading behind it. But when a table is used in these sections, the shading isn’t being applied. Any help would be much appreciated!

      EDIT: Here’s an image of what I’m trying to describe. https://i.imgur.com/X0ErxOX.png

    • #95162

      I think you will need to apply the shading in the table cell options.

      • #95175
        Ronald Cox
        Member

        I looked into that option, unfortunately there’s no way to overset the shading like you can with Paragraph shading, so I’m still left with white space where I want the shading to be.

    • #95176
      David Blatner
      Keymaster

      Yeah, I don’t think it’ll work… paragraph shading doesn’t appear to work on paragraphs with tables.

      • #95177
        Ronald Cox
        Member

        I think we’re in agreement, but I was hoping for a miracle answer :)

      • #95178
        Ronald Cox
        Member

        If you were working on this project, with probably 150-200 instances of tables in paragraphs, how would you do it?

      • #95227
        Masood Ahmad
        Participant

        Here’s how I’ll handle such situations. There’s ALWAYS an alternative way:

        I would go to Paragraph Shading Options and set the Bottom Offsets to the paragraph above the Tables and saved it as a Style.

        For your convenience you can download the InDesign file to try. Though I haven’t created a Style.

        https://www.dropbox.com/s/veoziy063mtd5ps/ParagraphShadingWithTables.png?dl=0

        https://www.dropbox.com/s/3h6quxziefx3a7m/Paragraph%20Shading.indd?dl=0

        I bet you wont need a script. And this workaround is absolutely FREE!

      • #95194

        David-I tested and had turned off paragraph shading on the table text. And then shaded the text cells with the same shading numbers. I think it was under the cell “fill” options.

        But it seems I am misunderstanding or something.

      • #95231
        Masood Ahmad
        Participant

        David, why is that Adobe comes up with some NEW feature and releases it without testing it. I think a Table is a basic thing in a layout and the Testing Team at Adobe should have tested the Paragraph Shading on Tables as well.

        Just ask them (Adobe) to hire a person like you before introducing something new.
        Said that you’ll be too busy then :)

    • #95183

      Think different!

      You have 3 aligned points A, B and C! … and a wire!
      The points A and C are, say, 2 trees and B a waterfall!

      I ask you to join the 3 points with the wire! Impossible because we can catch water? Absolutely not!

      All is only a matter of point of view!

      If you are able to apply a shading to the paras A and C but not B, apply a shading to cover A and C AND the space between them, occupied by the table!
      I did it and you can do it too!

      … but is it doable with 150-200 tables? … in 1 click!

      Yes! It’s only a mathematics and code problem!

      (^/) ;-)

      • #95184
        Ronald Cox
        Member

        This is… encouraging? Care to share your solution?

    • #95185

      To do what I mean, you’ll need a script! … and personally, I don’t write such a script for free!

      (^/)

      • #95190

        Obi–I thought the point of this site was to help people–not a place to post riddles and ask for money.

        As I said in an earlier post–if the issue is just the shading so it’s includes the paragraphs and the table, I think one can just turn off paragraph shading on the table text, and create a cell style with shading that matches the paragraph shading (while turning off paragraph shading on table text).

        I was under the impression that is what was wanted. That the entire section (text, table, text) was to be shaded.

      • #95229
        Masood Ahmad
        Participant

        Dwayne, I too have the same thoughts.

      • #95251

        Thank you, Masood.

    • #95186

      It’s quite possible I am wrong on this, but I tried a small test (actually three times). I was under the impression that the text and the table were supposed to be shaded. Kinda like one page of totally shading. All the same shade.

      I tested quickly, and I kept paragraph shading for the regular text–and turned off for the table text. Then I applied the same shading for the table cells and the entire page was shaded. I had to tweak the text paragraph shading so far as offset.

    • #95195

      Tried again–and I can’t automate. Paragraph shading above/below has to be adjusted.

    • #95203

      Dwayne,

      You don’t know me! So, please, keep your comments about me in your pocket, like others.

      Here, Ronald has 2 questions:

      How to do it once?
      How to do all in 1 click?

      I answered these 2 questions …

      To help you to visualize, you could make a small sketch with a pencil and a white paper (or another color if you want) :

      A script can extract the Y-Offset of the baseline of the last line of the para [A] above the table [B], the height of this table and the Y-Offset of the baseline of the line-para that supports it, and finally, the Y-Offset of the baseline of the first line of the para [C] below the table!

      These data for each table are enough to allow you to play!

      So, with this scenario, I let you write the script to help Ronald, for free of course!

      … and no need to thank me, I did it with pleasure!

      (^/) =D

    • #95226
      David Blatner
      Keymaster

      There is no doubt that a script could handle this, but you could also do it manually. For example, you could select the paragraph above the table, apply paragraph shading, and change the Bottom Offset of the paragraph shading so that it extends down under the table.

      • #95228
        Masood Ahmad
        Participant

        Hey David, Our replies match but your post came in first. :)

    • #95230

      … and do it 150-200 times!

      Oups! the layout has changed! Let’s play it again … 150-200 times!

      Oups again! … 150-200 times!

      …………

      Not very productive!

      But you’re all right! It could be done manually! Personally, I’m very too lazy for that! =D

      (^/)

    • #95239

      @Ron: Why not use the fill color of the table? And why is there an inset left and overset right? > If paragraph shading would be possible, the fills would not align perfectly.

      @Masood: Sometimes things are not implemented, because no one have the idea to use a feature in that way or the engineers have no capacities for everything.

      If I understand the feature correct, it is based on the fontsize of the paragraph. Since a table behave like a single character, but with no fontsize, it is not possible to measure the dimensions for the shading-feature.

      Not helpful, but interesting: If you span your para, that hold the table, in two, insert a real character, then para shading is working.

      So I vote either for table fills or a script, especially if the tables have different heights.

      Kai

      • #95258
        Masood Ahmad
        Participant

        @Kai, Thanks a lot for describing it so nicely. But I still think that a shading with Tables should have been noticed by the Adobe. They have a team of exports who could have avoided this easily.

    • #95240
      David Blatner
      Keymaster

      When I look at the image that Ronald included in his original post, I think it would be impossible to do this with table color fill (because the shading must extend outside the table, and even outside the text frame).

      The amazing thing about this thread is that I think there are people from 4 or 5 different countries, and at least 3 different languages! Of course, because it is in English, we must remember that sometimes meaning and intention is difficult to communicate.

      But I very much appreciate the community trying to help in our various ways!

    • #95241

      David, I saw this extending. If this is really needed, we could fake the insets with addtional blank columns?!

    • #95247

      I forgot I’ve written this script at 04/22/2017:

      0149_RoundCornersTable-Batch_MichelAllio.jsx

      Here’s its little brother:

      0173A_TableShading-Batch_MichelAllio.jsx

      [Alas, not for free!]

      I’ve just included the shading feature!

      Especially for Masood and Dwayne:

      (^/) ;-)

      • #95249

        Congratulations. Don’t “especially” for me. I have no intention of watching it.

    • #95253

      The only thing I could do was add an extra blank column on both sides of the table (the width of the shade extension). Then used the cell fill on all the columnns. That shaded properly. The only issue, of course, is the white space above and below the table, which can be fixed by adjusting the offset on the previous paragraph so it goes down to the table; and adjusting the paragraph below so the offset fills in above.

      I tried to do a rule above/below on the table of the proper length and offsets and shading, but it didn’t work. I had thought it would as you can do it on anchored boxes. But apparently not on tables.

      Hang on–I cut and pasted the table and placed into a separate text box and anchored it. I kept the fill-in in the cells and deleted the two outside columns I earlier used.

      Since the table box is not technically a table now but an anchored object I was able to use the paragraph above and below for the rules (with the offset and shading. The top rule was huge (100 point).

      Creating cell styles for the shading, and a style for the paragraph return that is the table anchor could speed things up.

      It will require cutting and pasting the tables into boxes and anchoring, and tweaking the rules above/below on some tables, but if you set the to rule to really big, it may not be necessary. And add the text spacing above/below to the anchored paragraph style.

      I’d guess a hundred or so would take a half-day to set up that way.

      I guess it depends upon how much time you have for the project and the budget. And how often you get jobs like that.

      It may be cheaper to buy Obi’s script.

      David: I did try to use the paragraph shading to extend past the table (before it was anchored as an anchored object) and the shading stopped at the top cell. It wouldn’t go past it.

      • #95254

        Note: Paragraph shading works on the anchored tables. So, we know that we can use paragraph shading on anchored objects, but not tables (unless they are cut and pasted and anchored).

    • #95257

      Dwayne Harris said:

      “… It may be cheaper to buy Obi’s script. …”

      What a positive attitude and a good concession at last! =D

      (^/)

      • #95259

        I wouldn’t necessarily call it a concession =D

    • #95261

      Aha! However, it’s a beginning! ;-)

      I’ve written a more powerful version!

      It’s based on the Shading Bottom Offset calculation relatively to the table height!

      The user can play with all kinds of selection (one table: cursor into it, selected cells/lines/columns ; single text frame ; active document ; all open docs).

      It have an “Undo”!

      After running the script once, if a table is modified and have a new (width/height) dimension, the user simply launches the script again: the script loops on all the tables and only plays with the modified one and refreshes the view!

      Always especially for my fans! ;-)

      (^/)

    • #95272

      Hi all!

      After 2 videos I know you liked a lot, you can now download my ID test file [CC 2015] and the script no 0173_TableShading-Batch or “how to apply a shading to tables when you can’t!”.

      https://www.dropbox.com/s/w82p1tn33srjeq4/0173_TableShading-Batch_MichelAllio—-TrialVersionAvaluableUntil-10-07-2017.zip?dl=0

      (^/)

      PS: The bad news is that it’s a jsxbin file (no access to the [JS] code), locked on the test file and limited to 1 month.
      But it’s totally playable for fun! ;-)
      So…

      ENJOY! =D

      • #95273

        Thanks, but I have no need as I don’t have any jobs that require it.

        Congratulations on doing a script to get around the issue.

    • #101609

      I had a similar situation. Managed to put a non-printing character (a discretionary line break, to be specific) before and after the table, but in the same paragraph that “holds” the table itself. Shading then worked.

      However, InDesign forced them onto three lines. To address this, I set the leading for that paragraph style to zero, and adjusted space above/below as needed.

      • #114608
        Edd Grinham
        Member

        Had been wrangling with this for a little while – Hadn’t thought of using discretionary line breaks! Genius!

        All works great

    • #105084
      Jon Hooton
      Member

      Using Michael’s solution above, if you create a character style with 0 leading and 0.1pt text you can apply that to the 1st and 3rd lines and then a new paragraph style using GREP to apply it to the first and last return in a paragraph which should work in most cases.

    • #14394059

      This is an old post but the problem still exists in 2023… I have a small and very easy trick with NO SCRIPT and NO GREP :

      Just add a FORCE RETURN character BEFORE and AFTER the table.

      Note: It will add a space before and after the table, but you can create a dedicated paragraph style with a smaller line height…

Viewing 20 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads