• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add stroke to cell without affecting other cells in table

Community Beginner ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

I want to add strokes to the inside of a table cell, so the stroke on that cell doesn't affect the postiion of other cells in the table.  I've read all kinds of posts about tables and strokes and can't sort this out.

 

Here's a simple way to reproduce this, starting from a blank document:

  • Make a table style called borderless_table, with Table Border > Weight set to 0.
  • Make a cell style called borderless_cell, with Cell Stroke > Weight set to 0.
  • On the stroke panel, set Align Stroke to Inside.
  • On Window > Object & Layout > Transform, click menu and uncheck Dimensions Include Stroke Weight.
  • Make a text frame.
  • Make a table based on borderless_table style, with 1 column and 2 rows.
  • Select both cells and set their style to borderless_cell.
  • Expand the second cell so the bottom of the cell aligns with the bottom of the text frame.
  • Select the first cell and make a new cell style called bordered_cell, with Cell Stroke > Weight set to 4 so we can see the border easily.

This creates a border that pushes the first cell to the right and down, and pushes the second cell down so it overflows the text frame.

 

Is there a way to add a stroke to the first cell so the stroke is placed entirely inside the cell, without affecting the position of the second cell?

 

Screen Shot 2021-03-12 at 11.55.56 AM.png

 

TOPICS
How to

Views

288

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 15, 2021 Mar 15, 2021

A workaround --

You could set up a table with more rows and columns than are needed and fill the thin rows and columns to make them appear as strokes.

image.png

Filled with black.

image.png

Votes

Translate

Translate
Community Expert ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

The only way I know how to do that rather clunky.

Create a text frame separately from the table and give it a thick stroke set to inside using the Stroke panel. Then cut and paste the text frame into a table cell. The cell needs to have zero inset so that the text frame goes all the way to the edges of the cell. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

Hi ehmatthes,

could you live with a result like that? :

 

TableCharacterSetToCenterAlign-1.PNG

 

I set the paragraph holding the table to Center Align:

TableCharacterSetToCenterAlign-2.PNG

The horizontal inset values for all my cells are the same.

 

Regards,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

Hi, first off your replies in so many other threads have been really helpful. I appreciate what you share here. 🙂

 

This solution looks nicer horizontally, but it still pushes the lower cells down. My use case is a set of cheat sheets. I have them nicely laid out in color, but all of the graphic design work is done using fills. I want to have a set of styles that I can apply to generate a well-formatted black and white version of the document that looks good when printed on a black and white printer. Shading doesn't work as well for that, so I'd like to use strokes instead of fills to highlight some cells visually. In the color document, the bottommost cell in each column is stretched to fill the column, so the bottom edges all line up nicely. Even a 1-pixel stroke pushes these cells down enough to make them overflow.

 

I'm getting around this in a fairly klunky way because I have a script that manages the export process. It already exports a number of color pdfs - one pdf for the whole set of sheets, and then individual pdfs for each sheet. I've been adding code that converts the styles to the corresponding bw styles. My kludgy solution has been to reduce the cell insets in the script just before converting to the bw styles. But that's not perfect, and it means I can only see the effect by running the script.

 

It really seems that "add a stroke to this cell but don't affect other cells in any way" would be a common use case. Would I be better off using a series of text frames instead of table cells?

 

Each page in the document is made of three columns, where each column is its own table:

Screen Shot 2021-03-15 at 11.37.51 AM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

"It really seems that "add a stroke to this cell but don't affect other cells in any way" would be a common use case." -- I'm totally with you on that!!!! Enhancement requests can be submitted at https://indesign.uservoice.com/

A pity to have to resort to it, but your idea to use a series of text frames would work.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

LATEST

A workaround --

You could set up a table with more rows and columns than are needed and fill the thin rows and columns to make them appear as strokes.

image.png

Filled with black.

image.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines