3

How to align the contents of the \thead cell to the right?

\documentclass[12pt]{memoir}

\usepackage{tabularx}
\usepackage{makecell}

\begin{document}

    \begin{tabular}{|c|}
    \thead{Content \\ Other alignment}
    \end{tabular}

\end{document}

enter image description here

I know I can globally override all \thead environments alignment with something line \renewcommand\theadalign{ll}. Is there another way other than globally overriding all \thead environments alignment, i.e., doing it only for one cell?

  1. How to add a forced line break inside a table cell
user
  • 4,745

2 Answers2

8

You can achieve this by specifying that option in \thead. Such as \thead[r], \thead[l], \thead[c], etc.

\documentclass[12pt]{memoir}
\usepackage{tabularx}
\usepackage{makecell}

\begin{document}

    \begin{tabular}{|c|}
        \thead[l]{Content \\ Other alignment}\\
        \hline
        \thead[c]{Content \\ Other alignment}\\
        \hline
        \thead[r]{Content \\ Other alignment}\\
    \end{tabular}

\end{document}

enter image description here

3

Use \thead[l]{...} option.

\documentclass[12pt]{memoir}

\usepackage{tabularx}
\usepackage{makecell}

\begin{document}

    \begin{tabular}{|c|c|c|c|}
    \thead[l]{Content \\ Other alignment} &
    \thead[r]{Content \\ Other alignment} &
    \thead[t]{Content \\ Other alignment} &
    \thead[b]{Content \\ Other alignment}         
    \end{tabular}

\end{document}