1

I have the following table:

\begin{table}
    \begin{tabular}{ | p{2cm} | p{9cm} |}
    \hline
    \textbf{Heading 1} & \textbf{Heading 2} \\ \hline
    Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et\tabularnewline \hline
    Foo Ba Foo Ba Foo Ba & \centering \checkmark \tabularnewline \hline
    \end{tabular}
\end{table}

It looks like this: table_vertically_align_checkmark

I want that the checkmark is vertically aligned. I tried it with \vcenter \centering \checkmark \tabularnewline \hline but I got a lot of errors.

Any help would be greatly appreciated.

3 Answers 3

1
\documentclass{article}

\begin{document}


\begin{table}
    \begin{tabular}{ | p{2cm} | p{9cm} |}
    \hline
    \textbf{Heading 1} & \textbf{Heading 2} \\ \hline
    Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et\tabularnewline \hline
    Foo Ba Foo Ba Foo Ba & \vfil\hfil $\heartsuit$ \tabularnewline \hline
    \end{tabular}
\end{table}

\end{document}

enter image description here

1
2

Package multirow provides \multirow, which can be used to center/move material vertically. Here, it is a little overkill and the number of lines must be added manually, see the answer of Przemysław Scherwentk for a shorter solution using \vfil.

\documentclass{article}
\usepackage{multirow}
\usepackage{pifont}
\providecommand*{\checkmark}{\ding{51}}

\begin{document}
  \begin{table}
    \centering
    \begin{tabular}{ | p{2cm} | p{9cm} |}
      \hline
      \textbf{Heading 1} & \textbf{Heading 2} \\ \hline
      Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
      nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
      sed diam voluptua. At vero eos et accusam et\tabularnewline
      \hline
      Foo Ba Foo Ba Foo Ba &
      \multirow{2}{\linewidth}{\centering\checkmark}\tabularnewline
      \hline
    \end{tabular}
  \end{table}
\end{document}

Result

And a version with less lines using package booktabs:

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{pifont}
\providecommand*{\checkmark}{\ding{51}}

\begin{document}
  \begin{table}
    \centering
    \begin{tabular}{ p{2cm} p{9cm} }
      \toprule
      \textbf{Heading 1} & \textbf{Heading 2} \\
      \midrule
      Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
      nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
      sed diam voluptua. At vero eos et accusam et\tabularnewline
      \addlinespace
      Foo Ba Foo Ba Foo Ba &
      \multirow{2}{\linewidth}{\centering\checkmark}\tabularnewline
      \bottomrule
    \end{tabular}
  \end{table}
\end{document}

Result with booktabs

0

An alternative (a bit more complicated) solution:

\documentclass[border=3mm,
               preview]{standalone}
    \usepackage{amsmath,amssymb}
    \usepackage{makecell,multirow}% added 
    \begin{document}
\begin{table}
    \begin{tabular}{ |p{2cm}|p{9cm}|}
    \hline
    \textbf{Heading 1} & \textbf{Heading 2}              \\  \hline
    Foo & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et\tabularnewline \hline
    Foo Ba Foo Ba Foo Ba & \multirowcell{2}{\checkmark}   \\  \hline
    \end{tabular}
\end{table}
    \end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .