# Hanging indent with makecell

I'm using \usepackage{makecell} to break up some long text inside my tables. I would like to have a hanging indent for that cell. I see some documentation about customizing such aspects, but modifying it to fit this need is beyond me. Thanks for any help.

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{lc}
\makecell[l]{Some really long text\\ which I would like\\ to break up\\ with a hanging indent} & Short Text
\end{tabular}
\end{table}


Edit:

In the makecell documentation here (starting on page 9) you'll see various alignment options, including indenting the first line http://ctan.mirrors.hoobly.com/macros/latex/contrib/makecell/makecell.pdf . However, I would like a hanging indent, as below. I know I can add a forced spacing to each line, but is there a more compact way?

If I understand well what you mean by a hanging indent, I don't think it can be done within makecell, which is done for standard r, l or c cells. However, you can easily obtain it with a p{some length} cell. I took the opportunity to simplify the code for column heads, with the \thead command, and to have a better spacing between caption and table, with the caption package:

\documentclass{article}
\usepackage{array, tabularx, caption, makecell}
\usepackage{amsmath}

\begin{document}

\begin{table}[!htb]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{>{\hangindent=1.5em\hangafter=1}p{4cm}c}
Some really long text\newline which I would like\newline to break up\newline with a hanging indent & Short Text
\end{tabular}
\end{table}

\end{document}


It is possible to do this with \makecell per the documentation:

\begin{tabularx}{\textwidth}{XXX}
Hello
& \makecell[{{>{\hangindent1em}X}}]{A very long strng of text which really should be broken at some point hopefully, and should be hung-indented.}
& World
\end{tabularx}


You can even go a step further, and define a custom column type:

% in preamble
\newcolumntype{I}{>{\hangindent1em}X}

% ...

% in document body
\begin{tabularx}{\textwidth}{XXX}
Hello
& \makecell[{I}]{A very long strng of text which really should be broken at some point hopefully, and should be hung-indented.}
& World
\end{tabularx}