将表格中的枚举/逐项与矩形文本对齐

将表格中的枚举/逐项与矩形文本对齐

如何让列表与前面的文本垂直对齐?在中间单元格中,我希望 1. 与“输入”垂直对齐。在底部单元格中,“目标”应位于 1. 和 2 之间的垂直中间。

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes}
\begin{document}

\tikzstyle{rect} = [rectangle split, rectangle split parts=3, draw]

\begin{tikzpicture}[]
\node[rect](first) {
\textbf{Parse FCC Broadband Availability Data}
\nodepart{two}
Inputs:
\begin{tabular}{p{5cm}}
\begin{enumerate}
    \item FCC Form 477 Data
\end{enumerate}
\end{tabular}
\nodepart{three}
Goals:
\begin{tabular}{p{5cm}}
\begin{enumerate}
    \item Select states and ISPs
    \item Baseline for comparison.
\end{enumerate}
\end{tabular}
};

\end{document}

物品

答案1

tikzpicture我建议使用简单的,而不是tabular。借助,cellspace您可以调整单元格中文本上方和下方的间距。我使用了enumitem包来定义自定义tabenum环境:

在此处输入图片描述

\documentclass{article}

\usepackage{array}

\usepackage{enumitem}
\newlist{tabenum}{enumerate}{1}
\setlist[tabenum]{label*=\arabic*.,leftmargin=*, nosep,leftmargin=*,before=\begin{minipage}{\hsize},after=\end{minipage}}

\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{\tabcolsep}
\setlength{\cellspacebottomlimit}{\cellspacetoplimit}

\begin{document}

\noindent
\begin{tabular}{|0l0{p{4.25cm}}|}
\hline
\multicolumn{2}{|0c|}{\bfseries Parse FCC Broadband Availability Data}\\
\hline
Inputs: & \begin{tabenum} 
            \item FCC Form 477 Data 
          \end{tabenum} \\
\hline
Goals: & \begin{tabenum}
           \item Select states and ISPs
           \item Baseline for comparison.
          \end{tabenum} \\
\hline
\end{tabular}

\end{document}

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}

\usepackage{array}

\usepackage{enumitem}
\newlist{tabenum}{enumerate}{1}
\setlist[tabenum]{label*=\arabic*.,leftmargin=*, nosep,leftmargin=*,before=\begin{minipage}{\hsize},after=\end{minipage}}

\usepackage[column=0]{cellspace}
\setlength{\cellspacetoplimit}{\tabcolsep}
\setlength{\cellspacebottomlimit}{\cellspacetoplimit}

\begin{document}
\begin{tikzpicture}
\node(first) {
  \begin{tabular}{|0l0{p{4.25cm}}|}
  \hline
  \multicolumn{2}{|0c|}{\bfseries Parse FCC Broadband Availability Data}\\
  \hline
  Inputs: & \begin{tabenum} 
              \item FCC Form 477 Data 
            \end{tabenum} \\
  \hline
  Goals: & \begin{tabenum}
             \item Select states and ISPs
             \item Baseline for comparison.
            \end{tabenum} \\
  \hline
  \end{tabular}};
\node[below=of first](second) {
  \begin{tabular}{|0l0{p{4.25cm}}|}
  \hline
  \multicolumn{2}{|0c|}{\bfseries Parse FCC Broadband Availability Data}\\
  \hline
  Inputs: & \begin{tabenum} 
              \item FCC Form 477 Data 
            \end{tabenum} \\
  \hline
  Goals: & \begin{tabenum}
             \item Select states and ISPs
             \item Baseline for comparison.
            \end{tabenum} \\
  \hline
  \end{tabular}};
\draw [->] (first) -- (second);
\end{tikzpicture}
\end{document}

相关内容