Text FormattingText Formatting in a table

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
rbmoseki
Posts: 10
Joined: Sun May 21, 2023 7:53 pm

Text Formatting in a table

Post by rbmoseki »

Good Day,

I have a two column table and the text in just near the top line of the block.

Can you assist in getting the text in the middle of the block instead of the top. That is aligning the text in the block to be in the center and not the top part

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Text Formatting in a table

Post by Stefan Kottwitz »

You could use tabular within a tabular cell (and make a macro for it not to have to type so much, or \vcenter, or \adjustbox, or \parbox within the cell for alignment, putting \parbox into a column type specifier for example.

Stefan
LaTeX.org admin
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Text Formatting in a table

Post by rais »

An alternate way may be to use array's m column. Just don't mix m with p columns within the same tabular environment, that may have the opposite effect: if, say, you specify m for the shorter text (that ended up at the top) but p for the longer text, the shorter text gets vertically centered to the longer text's top line, so instead of vertically centering both column's cells you'd drop the longer cell by about half the height of the shorter cell (if that goes over more than a single line, too).
Pitfalls all around :lol:

KR
Rainer
Post Reply