![在表格中包含框和箭头的最佳方法是什么?](https://linux22.com/image/427562/%E5%9C%A8%E8%A1%A8%E6%A0%BC%E4%B8%AD%E5%8C%85%E5%90%AB%E6%A1%86%E5%92%8C%E7%AE%AD%E5%A4%B4%E7%9A%84%E6%9C%80%E4%BD%B3%E6%96%B9%E6%B3%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
答案1
\documentclass{article}
\usepackage{tikz}
\newlength{\mylength}
\settoheight{\mylength}{S}
\tikzset{mybox/.style={draw=black,text width=2cm, align=center},
baseline={([yshift=-\mylength]current bounding box.north)}}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{label=\textbullet,
noitemsep,
leftmargin=*,
topsep=0pt,
partopsep=0pt,
nosep,
before=\begin{minipage}[t]{\hsize}\raggedright,
after=\end{minipage}}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{c XX}
\toprule
Column1 & Column2 & Column3 \\
\midrule
\begin{tikzpicture}[remember picture]
\node (A) [mybox] {Box 1};
\end{tikzpicture}
& \begin{tabitemize} \item some longer text in this item \item some text \end{tabitemize}
& \begin{tabitemize}\item some text \end{tabitemize}\\
\addlinespace
\begin{tikzpicture}[remember picture]
\node (B) [mybox]{Box 2};
\end{tikzpicture}
& \begin{tabitemize} \item some text \item some text \item some text \item some longer text in this item \item some text \end{tabitemize}
& \begin{tabitemize}\item some text \item some longer text in this item \item some longer text in this item \end{tabitemize}\\
\addlinespace
\begin{tikzpicture}[remember picture]
\node (C) [mybox] {Box 3};
\end{tikzpicture}
& \begin{tabitemize} \item some text \item some text \end{tabitemize}
& \begin{tabitemize}\item some text \end{tabitemize}\\
\bottomrule
\end{tabularx}
\begin{tikzpicture}[overlay, remember picture, ultra thick, ->]
\draw (A) -- (B);
\draw (B) -- (C);
\end{tikzpicture}
\end{document}
答案2
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{\tabcolsep}
\setlength{\cellspacebottomlimit}{\cellspacetoplimit}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\usepackage{makecell}
\begin{document}
\minipage{\textwidth}
\begin{tabular}{ 0c0c0c }
\toprule
Column1
&Column2
&Column3 \\
\midrule
\begin{tikzpicture}[baseline=(current bounding box.center), remember picture]
\node (A) [draw=black,text width=2cm, align=center] {Box 1};
\end{tikzpicture}
&\makecell[t]{\tabitem some text\\\tabitem some text}
&\tabitem some text\\
\begin{tikzpicture}[baseline=(current bounding box.center), remember picture]
\node (B) [draw=black,text width=2cm, align=center]{Box 2};
\end{tikzpicture}
&\makecell[t]{\tabitem some text\\\tabitem some text}
&\tabitem some text\\
\bottomrule
\end{tabular}
\begin{tikzpicture}[overlay, black, remember picture]
\draw[ultra thick, ->] (A.south) -- (B.north);
\end{tikzpicture}
\endminipage
\end{document}