如何创建盒装表格数组

如何创建盒装表格数组

我正在尝试复制所附图片。但是,我不太确定要使用哪种类型的命令或环境。我认为这不仅仅是简单的表格或小页面环境。如果有人能帮助我,那就太好了。谢谢。

在此处输入图片描述

答案1

使用基本工具的解决方案:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} 
\usepackage{array}
\setlength{\extrarowheight}{2pt}
\usepackage{makecell}

\newcommand*{\myhline}{\hline
\noalign{\vskip 1ex}
\hline}


\begin{document}

\bgroup\setlength{\arraycolsep}{2pt}
   \begin{alignat*}{3} \setcellgapes{4pt}\makegapedcells
   & \begin{array}{ | *{5}{c |}}
    \hline
E_1 & E_3 & E_3 & E_3 & E_4 \\
\myhline
E_1 & E_3 & E_3 & E_4 & E_3 \\
\myhline
E_1 & E_3 & E_4& E_3 & E_3 \\
\myhline
E_1 & E_4 & E_3& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_1 & E_3 & E_4 \\
\myhline
E_3 & E_3 & E_1 & E_4 & E_3 \\
\myhline
E_3& E_4 & E_1& E_3 & E_3 \\
\myhline
E_4 & E_3 & E_1& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_3 & E_4 & E_14 \\
\myhline
E_3 & E_3 & E_4 & E_3 & E_1 \\
\myhline
E_3& E_4 & E_3& E_3 & E_1 \\
\myhline
E_4 & E_3 & E_3& E_3 & E_1 \\
    \hline
    \end{array}
     \\[3ex]
%
    & \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_1 & E_3 & E_3 & E_4 \\
\myhline
E_3 & E_1 & E_3 & E_4 & E_3 \\
\myhline
E_3 & E_1 & E_4& E_3 & E_3 \\
\myhline
E_4 & E_1 & E_3& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_3 & E_1 & E_4 \\
\myhline
E_3 & E_3 & E_4 & E_1 & E_3 \\
\myhline
E_3& E_4 & E_3 & E_1 & E_3 \\
\myhline
E_4 & E_3 & E_3& E_1 & E_3 \\
    \hline
    \end{array}
 \end{alignat*}
\egroup

\end{document} 

在此处输入图片描述

答案2

在此处输入图片描述

绘制为tikzpicture、使用matric和定位库:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{matrix,
                positioning}
\tikzset{mymatrix/.style = {matrix of math nodes,
                            nodes={draw, minimum width=2em, minimum height=3ex,
                                    inner sep=0pt, outer sep=0pt, anchor=center},
                            column sep=-0.5\pgflinewidth,
                            row sep=1ex
                            }
        }

\begin{document}
\begin{tikzpicture}[node distance =2mm and 3mm]
  \matrix (m11) [mymatrix]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
  \matrix (m12) [mymatrix, right=of m11]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
  \matrix (m13) [mymatrix, right=of m12]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
   \matrix (m21) [mymatrix, below=of m11]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
   \matrix (m21) [mymatrix, right=of m21]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
\end{tikzpicture}
\end{document}

相关内容