单元格内部和单元格之间带有框的表格

单元格内部和单元格之间带有框的表格

实现下图所示结果的最佳方法是什么?

在此处输入图片描述

这是目前的代码,缺少框

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array, mathtools}

\begin{document}

\begin{tabular}{|>{$}r<{$}|>{$}c<{$}|>{$}c<{$}|>{$}c<{$}|>{$}c<{$}|}
    \hline
       & a^k & b^k & c^k & d^k \\ \hline
    1. & & & & \\ \hline
    2. & & & & \\ \hline
    3. & & & & \\ \hline
    4. & & & & \\ \hline
    5. & & & & \\ \hline
    6. & & & & \\ \hline
    7. & & & & \\ \hline
    8. & & & & \\ \hline
    9. & & & & \\ \hline
    10. & & & & \\ \hline
    11. & & & & \\ \hline
    12. & & & & \\ \hline
    13. & & & & \\ \hline
\end{tabular}

\end{document}

答案1

TikZ

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{positioning, matrix}

\begin{document}
\begin{tikzpicture}
\matrix (A) [matrix of math nodes,
    nodes in empty cells,
    nodes={draw, minimum width=15mm, minimum height=7mm, outer sep=0pt, anchor=center},
    column 1/.style={nodes={minimum width=8mm}},
    column sep=-\pgflinewidth,
    row sep=-\pgflinewidth]
    { & a^k & b^k & a^k & b^k\\
    1.& & & & \\
    2.& & & & \\
    3.& & & & \\
    4.& & & & \\
    5.& & & & \\
    6.& & & & \\
    7.& & & & \\
    8.& & & & \\
    9.& & & & \\
    10.& & & & \\
    11.& & & & \\
    12.& & & & \\
    13.& & & & \\};
    \foreach \i [evaluate=\i as \ni using int(\i+1), evaluate=\i as \xi using (\ni-1)*15/4+8] in {1,2,...,13}
        {\node (v) [minimum width=6mm, minimum height=5mm, draw, fill=white] at ([xshift=\xi mm]A-\ni-1.west) {$v$};
            \node (x) [right=1mm of v, minimum width=6mm, minimum height=5mm, draw, fill=white]{$x$};}
\end{tikzpicture}
\end{document}

[1]:https://i.stack.imgur.com/a7R等式.png

相关内容