删除表格(列表周围)的顶部和底部边距

删除表格(列表周围)的顶部和底部边距

如果我创建一个包含多个(短)列表的表格,目前我使用带有 enumitem 的表格构造来(几乎)删除左边距。现在我在逐项列表的顶部和底部(上方和下方)仍然有一个相当大的边距。

有什么方法可以指示逐项列表或表格也删除此边距?

代码示例:

\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \begin{itemize}[leftmargin=*]
        \item A
        \item B
    \end{itemize} &
    \begin{itemize}[leftmargin=*]
        \item C
        \item F
    \end{itemize} \\
   \hline
\end{tabular}

答案1

除了使用 内部列表外,还有以下一些选项可供使用tabular

在此处输入图片描述

\documentclass{article}
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
Original: \par
\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \begin{itemize}[leftmargin=*]
        \item A Here is some text that should wrap inside the list
        \item B Here is some text that should wrap inside the list
    \end{itemize} &
    \begin{itemize}[leftmargin=*]
        \item C Here is some text that should wrap inside the list
        \item D Here is some text that should wrap inside the list
    \end{itemize} \\
   \hline
\end{tabular}

\verb|\textbullet| option: \par
\begin{tabular}{|m{3cm}|p{5.5cm}|p{5.5cm}|}
   \hline
    Category 2 &
    \textbullet~A Here is some text that should wrap inside the list \par
    \textbullet~B Here is some text that should wrap inside the list &
    \textbullet~C Here is some text that should wrap inside the list \par
    \textbullet~F Here is some text that should wrap inside the list \\
   \hline
\end{tabular}

Nested \verb|tabular| option: \par
\begin{tabular}{|m{3cm}|l|l|}
   \hline
    Category 2 &
    \begin{tabular}{@{\textbullet~}p{5cm}@{}}
      A Here is some text that should wrap inside the list \\
      B Here is some text that should wrap inside the list
    \end{tabular} &
    \begin{tabular}{@{\textbullet~}p{5cm}@{}}
      C Here is some text that should wrap inside the list \\
      F Here is some text that should wrap inside the list
    \end{tabular} \\
   \hline
\end{tabular}
\end{document}​

可以将最后一个选项修改为5.5cm与宽度完全相同。以上示例仅说明了在模拟列表外观/感觉的同时遵循紧密间距的列表替代方案。

相关内容