带项目符号的多行表

带项目符号的多行表

我有一张像这样的桌子在此处输入图片描述

我无法在 \multirow 函数中使用 itemize。我不太清楚如何实现这一点。

答案1

不需要\multirow

在此处输入图片描述

\documentclass{article}

\usepackage[letterpaper,margin=2.5cm]{geometry} % set suitable page size parameters
\usepackage{tabularx,ragged2e,booktabs,xcolor}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

\usepackage{enumitem}
% create a bespoke itemize-like environment:
\newlist{myitemize}{itemize}{1}
\setlist[myitemize]{label =\textbullet, nosep, left=0pt,
                    before=\begin{minipage}[t]{\hsize},
                    after =\end{minipage}}

\begin{document}

\begin{table}[htbp]
\setlength{\tabcolsep}{3pt}
\small
\begin{tabularx}{\textwidth}{@{} *{5}{L} @{}}
\toprule
\textbf{Key partners} & 
\textbf{Key activities} & 
\textbf{Value proposition} & 
\textbf{Customer relationship} & 
\textbf{Customer segments} \\
\midrule
\begin{myitemize}
\item \textbf{Supplier}
\item \textbf{Logistics}
\item \textbf{IT partner}
\item \textbf{Property owner (rent)}
\item \textbf{Media partner}
\end{myitemize}  &
\begin{myitemize}
\item Advertising \& marketing
\item Online platform
\item Logistics
\item Supply chain
\end{myitemize}
\medskip
\hrule height\lightrulewidth
\medskip
\textbf{Key resources}
\smallskip
\begin{myitemize}
\item Physical resources
\item Distribution network
\item Information technology
\item Human capital
\end{myitemize} &

\begin{myitemize}
\item \textcolor{red}{Vegan belief} 
\item Convenience
\item Accessibility
\item Communities
\item Customer service
\item Comparable (function, price, effort)
\item Lifestyle
\item Digital payments
\item Improve the physical and online shopping experience
\end{myitemize} &
\begin{myitemize}
\item Vegan club
\item Communities
\item Vegan blogs
\item Loyalty program
\end{myitemize}
\vspace{1\baselineskip}
\medskip
\hrule height\lightrulewidth
\medskip
\textbf{Channels}
\smallskip
\begin{myitemize}
\item Website
\item Own stores
\item Partner apps
\item Ad channels
\item Social media channels
\item Word of mouth
\item Comms channels
\end{myitemize} &
\begin{myitemize}
\item Income level
\item Motivation
\item Age range
\item Purchase - behavioral
\item Middle to upper class
\end{myitemize} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

答案2

我已经创建了您想要实现的目标的简化版本。如果您需要更多帮助,请告诉我 - 您应该可以从这里开始工作。

在此处输入图片描述

序言中允许你这样做的关键几行是:

\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

这些使您可以轻松地获得跨越多行的列表。

注意:我已经使用该包创建了我自己的itemize称为环境的环境,只是为了强加我自己的空白偏好。enumtableenumitem


上述代码:

% these define the type of document and the look of the page
\documentclass[]{article}
\usepackage[margin=1in]{geometry}
\setlength{\parindent}{0pt} % space at start of paragraph
\setlength{\parskip}{0.14in} % space between paragraphs

% table-related
\usepackage{array}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{multirow, hhline}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

% lists
\usepackage{enumitem} 
\newcommand{\bulletlabel}{\raisebox{0.2ex}{\small$\bullet$}}
\newlist{enumtable}{enumerate}{6}
\setlist[enumtable]{label=\bulletlabel, topsep=0.1in, leftmargin=0.2in, rightmargin=0.2in, itemsep= 0in, partopsep=0in}

% math
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\def\arraystretch{1.5}
\begin{tabular}{|L{5cm}|L{5cm}|L{5cm}|}
\hline
% first multi-row column
\multirow{2}{5cm}{
\textbf{Key partners}
\newline
\begin{enumtable}
\item Supplier
\item Logistics
\item IT partner 
\item Property owners (rent)
\item Media partner
\end{enumtable}
} 
& 
% single-row column
\textbf{Key partners}
\newline
\begin{enumtable}
\item Supplier
\item Logistics
\item IT partner 
\item Property owners
\item Media partner
\end{enumtable} 
&
% second multi-row column
\multirow{2}{5cm}{
\textbf{Key partners}
\newline
\begin{enumtable}
\item Supplier
\item Logistics
\item IT partner 
\item Property owners (rent)
\item Media partner
\end{enumtable}
} 
\\ \hhline{~-}
& 
\textbf{Key partners}
\newline
\begin{enumtable}
\item Supplier
\item Logistics
\item IT partner 
\item Property owners
\item Media partner
\end{enumtable} & \\ \hline
\end{tabular}

\end{document}

答案3

这是一个基于嵌套表格的示例。请注意,列表需要放置在段落式环境中。在我的例子中,这是通过使用p{}在单元格中创建段落的类型列来实现的。但是,直接放置在单元格中的其他构造也可以工作,例如minipage环境\parbox等。

目前,下面的示例在列表和文本之间使用标准间距。如果要减少它,最简单的方法是在每个列表前插入负间距。因此,before=\vspace{-0.5\baselineskip}在列表设置中附加( 行\setlist{...})。

\documentclass{article}
\usepackage{tabularx}
\usepackage{enumitem}

\newcolumntype{L}{>{\raggedright\arraybackslash}p{\dimexpr\linewidth-2\tabcolsep}}


\begin{document}
\begin{table}[tbh]
  \setlist[itemize]{noitemsep,leftmargin=*,after=\vspace{-\baselineskip}}
  \renewcommand{\arraystretch}{2}
  \setlength\extrarowheight{-2pt}   % correction for arraystretch
  \caption{Example table}\label{tab:example-table}
  \begin{tabularx}{\textwidth}{| *{3}{@{}X@{}|}}
    \hline
    \begin{tabular}[t]{L}
      \textbf{Header 1}\par
      \begin{itemize}\bfseries
      \item Sample
      \item Sample
      \item Sample
      \item sample
      \item Sample
      \item Sample
      \item Sample
      \item Sample
      \item sample
      \item Sample
      \item Sample
      \end{itemize}
    \end{tabular}
    & \begin{tabular}[t]{L}
        \textbf{Header 2}\par
        \begin{itemize}
        \item Sample
        \item Sample
        \item Sample
        \item Sample
        \end{itemize}
        \\ \hline
        \textbf{Header 3}\par
        \begin{itemize}
        \item Sample
        \item Sample
        \item Sample
        \end{itemize}
        \\ \hline
        \textbf{Header 4}\par
        \begin{itemize}
        \item Sample
        \item Sample
        \end{itemize}
      \end{tabular}
    & \begin{tabular}[t]{L}
        \textbf{Header 5}\par
        \begin{itemize}
        \item Sample
        \item Sample
        \item Sample
        \item Sample
        \item Sample
        \item Sample
        \end{itemize}
        \\ \hline
        \textbf{Header 6}\par
        \begin{itemize}
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \item Sample sample
        \end{itemize}
      \end{tabular}
    \\ \hline
  \end{tabularx}
\end{table}
\end{document}

在此处输入图片描述

相关内容