Table cell spacing

I frequently create documents containing photos in Writer. If the photographic content exceeds the text content I sometimes create “panels” of photos within the text by putting them inside a table. Unfortunately, I always end up with spacing above and below the photos, regardless of which of the 4 anchor options I select. I can correct this at the top by manually dragging the image upwards, but that isn’t the point of frame styles. This doesn’t work for the space below images. How can I force frames to completely fill a table cell?
In the attached file I’ve set the graphics style, the frame style and the table cell spacing to zero. But I still see a space above and below the frame.

Version: 7.2.5.2 (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_GB); UI: en-GB
Calc: threaded

Windows 10 Home 64 bit. Build 19044.1826
table_spacing.odt (132.3 KB)

The space above comes from your image being positioned relative to “Paragraph text area” vertically, while it should be positioned relative to “Entire paragraph area”.

The space below is from the empty paragraph following the frame (which is anchored to paragraph and uses optimal wrapping - i.e., it moves the text outside, does not allow the text to overlap the frame).

I myself would try to avoid the frame altogether, and put the caption into the cell text itself, and the picture anchored as character - in the paragraph above.

Or using the same “to paragraph” anchoring: table_spacing1.odt (140.2 KB)

1 Like

In addition to @mikekaganski’s good answer, I’d set some padding in table Border tab so that there is some gutter between columns and picture don’t touch each other.

Thanks for the suggestions. I have never understood the difference between “Paragraph text area” and “Entire paragraph area”. I suppose the latter includes any margins, but then that isn’t really a paragraph area.
Anyway, it doesn’t make any difference in my example. Neither does using any other anchoring options. Setting “Wrap off” doesn’t allow my frame to cover that empty paragraph in the table.
So it comes back to your workaround of deleting the frame completely and using that empty paragraph for the caption as you have done it. This does indeed work, but it also means inconsistent formatting through the document since other figures, not contained within tables, will have a frame.

Wrong, it fixes the top spacing.

And since you call the correct approach “workaround”, then you may use your “correct” approach together with fixed table row height (without automatic expansion) to also remove the bottom spacing.

It’s completely unclear why other figures need frames (because you may put captions without any frames) - you never explained your goals, so having partial input, one only can provide an output matching that partial data.

Well, it doesn’t get rid of the top space when I do it.
When I add a caption to a figure, a frame is added by Writer and the caption placed within it. My goal is to add captions to figures that I can then position within a text as a single item. This works out of the box.
I never used the word “correct”. Perhaps you misread.

RemovingSpaces

1 Like

You aren’t compelled to use Insert>Caption. You can do it manually, using the proper number range to get auto-numbering and assigning the proper (again) paragraph style so that all your captions have consistent formatting.

Insert>Caption is a shortcut for all these operations plus nesting everything inside a frame. If you have no need for the frame (and it is likely since you already encase the picture + caption inside a cell), do as I described.
And this can be as user-friendly as the menu command if you use AutoText.

Paragraph text area: the rectangle strictly containing text
Entire paragraph area: the text rectangle + indents at left and right + spacing above and below
Choosing one over the other, paired with wrap mode, permits many “artistic” placement of frames.

1 Like

OK, thanks. Food for thought.