將表格中的枚舉/逐項與矩形文字對齊

將表格中的枚舉/逐項與矩形文字對齊

如何使清單與前面的文字垂直對齊?在中間的儲存格中,我希望 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}

相關內容