在乳胶表中列出多列和奇数列

在乳胶表中列出多列和奇数列

我正在尝试创建一个如下所示的乳胶表,并寻求任何可能的帮助,因为我遇到了困难。

enter image description here

但是,我得到的结果非常糟糕,我几乎陷入困境。MWE 给了我一些不太好的妥协,并且存在以下问题:

  • 我无法在多列单元格中放入项目,因此我可以利用行的整个空间。
  • 彩色单元格没有 \hline
  • 我无法控制将标记单元格的垂直线放在哪里。
  • 我尝试过普通的 itemize,但没有用,所以我使用了 tabitem 环境,如表格中的项目符号未对齐

理想情况下,我希望有一个 3 列表格,其中多列跨越 1.5 列,并在其中添加 itemize,但由于我找不到任何解决方案,所以我就这样做了。无论如何,任何帮助使其看起来像上面的“黄金样本”的帮助都将不胜感激!

\documentclass{article}

\usepackage{xcolor,colortbl}
\usepackage{paralist}
\usepackage{booktabs}
\newenvironment{tabitem}{%
    \vspace*{-0.5\baselineskip}%
    \setdefaultitem{\normalfont\bfseries\textbullet}%
    {\normalfont\bfseries\textendash}{}{}%
    \setdefaultleftmargin{1.1em}{1.1em}{}{}{}{}%
    \begin{compactitem}%
    }{%
    \end{compactitem}%
    \vspace*{-\baselineskip}%
}

\begin{document}

\begin{table}

    \begin{tabular}{|p{0.16\textwidth}p{0.16\textwidth}p{0.16\textwidth}p{0.16\textwidth}p{0.16\textwidth}p{0.16\textwidth}|}
        \bottomrule
        \multicolumn{6}{|c|}{\textbf{Work system snapshot}}\\ \hline

        \multicolumn{3}{|c|}{\cellcolor{black!25}Customers} & \multicolumn{3}{c|}{\cellcolor{black!25}Products \& services}\\ \hline

        \multicolumn{3}{|l|}{People who have a need for the Smartdevice} & &
        \begin{tabitem} 
            \item smartdevice in white 
            \item smartdevice in black \end{tabitem} & \\ \hline

        \multicolumn{6}{|c|}{\cellcolor{black!25}Major activities or processes}\\ \hline

        \begin{tabitem} 
            \item Procurement 
            \item  Inventory Management 
            \item sales 
            \item Manufacturing 
            \item Billing system \end{tabitem} &&&&& \\ \hline

        \multicolumn{2}{|l|}{\cellcolor{black!25}Participants} & \multicolumn{2}{l|}{\cellcolor{black!25} Information} & \multicolumn{2}{l|}{\cellcolor{black!25}Technologies} \\ \hline

        \begin{tabitem}
            \item Owner 
            \item  Employees 
            \item  Customers 
            \item Users 
        \end{tabitem}
        &&
        \begin{tabitem}
            \item BOM 
            \item Order database which consist of: sales-, purchase and production orders)
            \item Inventory information
        \end{tabitem}
        &&
        \begin{tabitem}
            \item ERP system 
            \item ME \& MII system 
            \item Web interface 
        \end{tabitem} & \\ \toprule[0.2em]

    \end{tabular}

\end{table}
\end{document}

enter image description here

答案1

您可以使用类似下面的方法:

\documentclass{article}
\usepackage{xcolor,colortbl}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{label=\textbullet,nosep,after=\strut,align=parleft,leftmargin=*,}

\usepackage{calc}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1\textwidth-2\tabcolsep-0.6pt}}
\begin{document}
\noindent
\begin{tabular}{|*6{P{0.16}}|}
\hline
\multicolumn{6}{|c|}{\textbf{Work system snapshot}}\\ \hline
\rowcolor{black!25}\multicolumn{3}{|c}{Customers} & \multicolumn{3}{|c|}{Products \& services}\\ \hline
\multicolumn{3}{|P{0.5}}{
      \begin{tabitemize} 
      \item People who have a need for the Smartdevice 
      \end{tabitemize}} &
\multicolumn{3}{|P{0.5}|}{
      \begin{tabitemize} 
      \item smartdevice in white
      \item smartdevice in black 
      \end{tabitemize}}\\ \hline
\rowcolor{black!25}\multicolumn{6}{|c|}{Major activities or processes}\\ \hline
\multicolumn{3}{|P{0.5}}{
      \begin{tabitemize} 
      \item Procurement
      \item inventory management
      \item Sales
      \end{tabitemize}} &
\multicolumn{3}{P{0.5}|}{
      \begin{tabitemize} 
      \item Manufactoring
      \item Billing System
      \end{tabitemize}}\\ \hline
\rowcolor{black!25}\multicolumn{2}{|c|}{Participants} & \multicolumn{2}{c|}{Information} & \multicolumn{2}{c|}{Technologies}\\ \hline
\multicolumn{2}{|P{0.33}|}{
      \begin{tabitemize} 
      \item Owner 
      \item  Employees 
      \item  Customers 
      \item Users
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}|}{
      \begin{tabitemize} 
       \item BOM 
       \item Order database which consist of: sales-, purchase and production orders)
       \item Inventory information
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}|}{
      \begin{tabitemize} 
      \item ERP system 
      \item ME \& MII system 
      \item Web interface 
      \end{tabitemize}}\\ \hline

\end{tabular}
\end{document}

enter image description here

要减少项目上方和下方的垂直空间,您可以添加类似的,after=\vspace{-\baselineskip},before=\vspace{-0.5\baselineskip}命令\setlist

这里有一些额外的替代方法,因为您实际上并不需要所有的垂直线来使您的表格易于理解:

\documentclass{article}
\usepackage{booktabs}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{label=\textbullet,nosep,after=\strut,align=parleft,leftmargin=*,after=\vspace{-\baselineskip},before=\vspace{-0.75\baselineskip}}

\usepackage{calc}
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1\textwidth-2\tabcolsep}}


\begin{document}
\noindent
\begin{tabular}{*6{P{0.16}}}
\toprule
\multicolumn{6}{c}{\textbf{Work system snapshot}}\\
\midrule
\multicolumn{3}{l}{Customers} & \multicolumn{3}{l}{Products \& services}\\
\midrule
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item People who have a need for the Smartdevice 
      \end{tabitemize}} &
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item smartdevice in white
      \item smartdevice in black 
      \end{tabitemize}}\\
      \midrule
\multicolumn{6}{c}{Major activities or processes}\\
\midrule
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item Procurement
      \item inventory management
      \item Sales
      \end{tabitemize}} &
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item Manufactoring
      \item Billing System
      \end{tabitemize}}\\ 
      \midrule
\multicolumn{2}{l}{Participants} & \multicolumn{2}{l}{Information} & \multicolumn{2}{l}{Technologies}\\ 
\midrule
\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
      \item Owner 
      \item  Employees 
      \item  Customers 
      \item Users
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
       \item BOM 
       \item Order database which consist of: sales-, purchase and production orders)
       \item Inventory information
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
      \item ERP system 
      \item ME \& MII system 
      \item Web interface 
      \end{tabitemize}}\\ 
      \bottomrule
\end{tabular}
\end{document}

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage{xcolor,colortbl}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{label=\textbullet,nosep,after=\strut,align=parleft,leftmargin=*,after=\vspace{-\baselineskip},before=\vspace{-0.5\baselineskip}}

\usepackage{calc}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1\textwidth-2\tabcolsep}}

\begin{document}
\noindent
\begin{tabular}{*6{P{0.16}}}
\toprule
\multicolumn{6}{c}{\textbf{Work system snapshot}}\\

\rowcolor{black!25}\multicolumn{3}{l}{Customers} & \multicolumn{3}{l}{Products \& services}\\

\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item People who have a need for the Smartdevice 
      \end{tabitemize}} &
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item smartdevice in white
      \item smartdevice in black 
      \end{tabitemize}}\\

\rowcolor{black!25}\multicolumn{6}{c}{Major activities or processes}\\

\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item Procurement
      \item Inventory management
      \item Sales
      \end{tabitemize}} &
\multicolumn{3}{P{0.5}}{
      \begin{tabitemize} 
      \item Manufactoring
      \item Billing System
      \end{tabitemize}}\\ 

\rowcolor{black!25}\multicolumn{2}{l}{Participants} & \multicolumn{2}{l}{Information} & \multicolumn{2}{l}{Technologies}\\ 

\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
      \item Owner 
      \item  Employees 
      \item  Customers 
      \item Users
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
       \item BOM 
       \item Order database which consist of: sales-, purchase and production orders)
       \item Inventory information
      \end{tabitemize}} &
\multicolumn{2}{P{0.33}}{
      \begin{tabitemize} 
      \item ERP system 
      \item ME \& MII system 
      \item Web interface 
      \end{tabitemize}}\\ 
      \bottomrule
\end{tabular}
\end{document}

enter image description here

答案2

这是一个基于一系列 3 tabularxs 环境的解决方案,这些环境嵌套在一个tabular具有单个中心列的列表中。我用它makecell来格式化列标题和enumitem列表:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage[table, svgnames]{xcolor}
\usepackage{enumitem}
\usepackage{tabularx, makecell}
\usepackage{booktabs}
\usepackage{multicol}

\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother

\begin{document}

\begin{table}
  \renewcommand{\theadfont}{\cellcolor{Gainsboro!60! Lavender}\normalsize}
  \renewcommand{\theadalign}{lc}
  \setlength{\extrarowheight}{4pt}\setlist{wide = 0pt, leftmargin = *, itemsep = 0pt, after = \vspace*{\dimexpr-\baselineskip-\partopsep+ \topsep}}
    \sffamily
  \begin{tabular}{|@{}c@{}|}
    \bottomrule
    \textbf{Work system snapshot} \\ [0.5ex]
    \hline
    \begin{tabularx}{\linewidth}{ >{\compress}X|>{\compress}X|}
      \thead{Customers} & \thead{Products \& services} \\%
      \hline
      \begin{itemize}
        \item People who have a need for the Smartdevice \end{itemize} &
      \begin{itemize}
        \item smartdevice in white
        \item smartdevice in black \end{itemize}
    \end{tabularx} \\ \hline
    %
    \begin{tabularx}{\linewidth}{>{\compress}X|}
      \thead[cc]{Major activities or processes} \\ \hline
      \begin{multicols*}{2}
        \begin{itemize}
          \item Procurement
          \item Inventory Management
          \item sales \columnbreak
          \item Manufacturing
          \item Billing system \end{itemize}
      \end{multicols*}
    \end{tabularx} \\ [-1.5ex]
    \hline
    %
    \begin{tabularx}{\linewidth}{*{3}{>{\compress}X|}}
      \thead{Participants} & \thead{Information} & \thead{Technologies} \\ \hline
      \begin{itemize}
        \item Owner
        \item Employees
        \item Customers
        \item Users
      \end{itemize}
                           &
      \begin{itemize}
        \item BOM
        \item Order database which consist of: sales-, purchase and production orders)
        \item Inventory information
      \end{itemize}
                           &
      \begin{itemize}
        \item ERP system
        \item ME \& MII system
        \item Web interface
      \end{itemize} \\
       \toprule[0.2em]
    \end{tabularx}
  \end{tabular}
\end{table}

\end{document} 

enter image description here

相关内容