Instead of writing
\multicolumn{1}{m{<some still-to-be-determined length>}}{\lipsum[1]}
I would execute the instruction
\renewcommand{\tabularxcolumn}[1]{m{#1}}
in the preamble (after loading tabularx
, naturally) and then write
\lipsum*[1]
in the cell in question.
Longer explanation, as requested by the OP: The tabularx
environment in your example contains 1 column of type X
and 2 columns of type m
. An X
-type column is, by default, just a p
-type column whose width is calculated automatically by LaTeX. Importantly, p
-type columns have their material top-aligned. As a (probably unexpected!) by-product of this setting, the material in the 2 columns of type m
will not be vertically centered in general. (If the height of the material in the X
column exceeds the heights of the material in both m
columns -- as is the case in your example -- the taller of the 2 m
-type columns will be top-aligned, the shorter of the 2 m
-type columns will be vertically centered relative to the taller m
column, and the placement of the p
-type column will be different still. Ouch!) By running the instruction \renewcommand{\tabularxcolumn}[1]{m{#1}}
, the underlying type of the X
column is changed from p
to m
, and the desired result comes about, i.e., all 3 columns get vertically centered in the expected way.
Moral of the story: The frequency of puzzling (and likely unexpected and unwanted) placement outcomes drops sharply if the underlying type of all columns is the same, i.e., all-m
or all-p
. Mixing column types is likely to cause quite some frustration.
A full MWE:
\documentclass[10pt,a4paper]{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\newcommand{\scell}[1]{\cellcolor{black!25}\bfseries #1}
\newcommand{\slcell}[1]{\cellcolor{black!25}#1}
\usepackage{tabularx}
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\usepackage{booktabs,lipsum}
\begin{document}
\noindent
\begingroup
\renewcommand{\arraystretch}{1.3} % localize scope of this command
\begin{tabularx}{\linewidth}{% require "\arraybackslash" in final column only
| m{2.4cm} | X | >{\centering\arraybackslash}m{2.1cm} |}
\hline
\scell{Header 1} & \scell{Header 2} & \scell{Header 3}\\
\hline
\hline
Cell 1 & \lipsum*[1] & test \\
\hline
\end{tabularx}
\endgroup
\end{document}
\multicolumn{m{some length}}
sinceX
column type their contents as paragraphs?m