I have been trying for a few days now to fix this table in my Overleaf file. The multirows are extending past the page, and some of the cells are overlapping. There also seems to be a break in a \cline.
\documentclass[acmsmall, anonymous=true]{acmart}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcolumntype{d}{>{\centering}b{.03\textwidth}}
\begin{table}[hbt!]
\centering
\def\tabularxcolumn#1{m{#1}}
\begin{tabularx}{\textwidth}{cdYX}
\textit{Phase} & & \multicolumn{1}{c}{\textit{Step}} & \multicolumn{1}{c}{\textit{Difficulties a Potential Data Subject Faces with Each Step}} \\
\multicolumn{1}{c|}{\multirow{8}{*}{\textbf{Collection}}} & & \multirow{2}{=}{Data Source} & \multirow{2}{*}{looooooong looooooong looooooong looooooong cell looooooong looooooong looooooong looooooong cell}
\\ \cline{2-2}
\multicolumn{1}{c|}{} & & & \\
\multicolumn{1}{c|}{} & & \multirow{2}{*}{Subject Type} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{c|}{} & & & \\
\multicolumn{1}{c|}{} & & \multirow{2}{*}{Awareness and Consent} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{c|}{} & & & \\
\multicolumn{1}{c|}{} & & \multirow{2}{*}{Original Data Licensing} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{c|}{} & & & \\ \hline
\multicolumn{1}{l|}{\textbf{Packaging}} & & \multirow{2}{*}{Dataset Availability} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\
\multicolumn{1}{l|}{} & & \multirow{2}{*}{Dataset Licensing} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\
\multicolumn{1}{l|}{} & & \multirow{2}{*}{Prohibited Uses} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\ \cline{1-1} \cline{3-4}
\multicolumn{1}{l|}{\textbf{Use}} & & \multirow{2}{*}{Model Use} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\
\multicolumn{1}{l|}{} & & \multirow{2}{*}{Dataset Derivatives} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\
\multicolumn{1}{l|}{} & & \multirow{2}{*}{Derivative Domain Shift} & \multirow{2}{*}{x} \\ \cline{2-2}
\multicolumn{1}{l|}{} & & & \\ \cline{1-3}
\multicolumn{1}{l|}{\textbf{Retraction}} & & & \multirow{2}{*}{x} \\ \cline{2-3}
\multicolumn{1}{l|}{} & & &
\end{tabularx}
\caption[x]{\small x}
\label{table:source}
\vspace{-5mm}
\end{table}
\FloatBarrier
When I have tried some solutions I've found on other posts, like specifying the cell width, I instead get this:
A sketch of the desired output (apologize it is crappy, I just moved things around in paint):
Any help would be much appreciated.
Best Answer
I also made a solution with the
tabularray
package, which makes it much easier. This is a rather new package, so it may be a bit scary to use it. But it makes it much easier, as it automatically takes the actual size of cells into account. So it works also correctly with much larger texts, without you having to adjust numbers in\multirow
.I defined a rule (
\RR
) for the second column which I use instead of the\cline{2-2}
. This is more robust. I also vertically centered the labels in the first column.