![带有插入单元格的表格,用于传达两个级别的信息](https://linux22.com/image/350394/%E5%B8%A6%E6%9C%89%E6%8F%92%E5%85%A5%E5%8D%95%E5%85%83%E6%A0%BC%E7%9A%84%E8%A1%A8%E6%A0%BC%EF%BC%8C%E7%94%A8%E4%BA%8E%E4%BC%A0%E8%BE%BE%E4%B8%A4%E4%B8%AA%E7%BA%A7%E5%88%AB%E7%9A%84%E4%BF%A1%E6%81%AF.png)
我正在尝试在 LaTeX 中创建一个表格,其中每个单元格被分成两部分。该表格的目的是传达两条信息。但是,这是一个 10 X 10 的表格。这意味着阅读表格并不愉快。因此,我认为为了更好地呈现信息,我可以在插入单元格(例如 TD)中显示一条信息,在灰色填充单元格中显示另一条信息。例如,像这个表格:
我怎样才能做到这一点?
答案1
我想我终于让它工作了!这是我用过的。
%\usepackage{tikz}
%\usetikzlibrary{matrix}
\newcommand{\insetcell}[2]{
\begin{tikzpicture}
\node (node1) [rectangle, draw = white, rounded corners, align = right, text depth = 0.1cm, text height = 1cm , text width = 1.5cm] at (0,0) {#1};
\node [anchor = north west, text depth = 0.05cm, text height = 0.5cm , text width = 0.5cm] at (node1.north west) {#2};
\end{tikzpicture}
}
\begin{tikzpicture}
\matrix [matrix of nodes, nodes = {draw, rounded corners, text centered}, column sep = 0.5 cm, row sep = 0.5 cm]
{
\insetcell{1}{3} & \insetcell{1}{3} & \\
\insetcell{1}{3} & & \\
\insetcell{1}{3} & \insetcell{I hope this works}{3} & \\
};
\end{tikzpicture}