0

Please take a look at the table below:

enter image description here

Is there any way to vertically align an individual table cell in LaTex as shown in the "I" cell above?

  • Welcome to TeX.SX! There is most likely more than just one way to change the vertical alignment of the contents of a single sell. Could you please add some background information on why you want to do that, as well as some information on what the contents of your actal table will be (numbers, single words, text...)? – leandriis Oct 05 '19 at 12:53
  • Yes, of course, but, do you want all the rows with the same fixed heigth? And the columns width? – e_moro Oct 05 '19 at 12:58
  • @leandriis I'm making a builder that converts an XML table into a LaTex table. Since source XML tables are configured to have an alignment attribute for every single cell, the target LaTex table also should have that feature. – user12037364 Oct 05 '19 at 13:00
  • @e_moro No, the height will be dynamically resized according to the length of text. – user12037364 Oct 05 '19 at 13:01
  • https://tex.stackexchange.com/a/6496/134144 might be interesting. – leandriis Oct 05 '19 at 13:10
  • @leandriis Thank you, but that assumes a fixed cell height (3.7\baselineskip). My table's cell height must resize dynamically. – user12037364 Oct 06 '19 at 13:27

1 Answers1

1

There are two new vertical h and f alignment with tabularray package and you can set vertical alignment for an individual table cell:

\documentclass{article}

\usepackage{xcolor} \usepackage{tabularray}

\begin{document}

\begin{tblr}{ colspec = {Q[h]Q[m]Q[f]}, rowspec = {Q[l]Q[c]Q[r]}, hlines, vlines, } Head Left & Middle Left & {Foot Left\Foot Left\Foot Left} \ Head Center & {Middle Center\Middle Center\Middle Center} & Foot Center \ {Head Right\Head Right\Head Right} & Middle Right & \SetCell{h,l,fg=blue3} Head Left \ \end{tblr}

\end{document}

enter image description here

L.J.R.
  • 10,932