两个不同高度的列 — 多行表

两个不同高度的列 — 多行表

我正在处理表格,我想要获得这样的表格:

表模型

我写了这个非常基本的代码:

\documentclass[a4paper,12pt]{article}

\usepackage{array,multirow,graphicx}
\usepackage[table,xcdraw]{xcolor}

\begin{document}

\begin{table}[h]
\begin{tabular}{l|l|}
\hline
\multicolumn{1}{|l|}{\cellcolor[HTML]{C0C0C0}\rotatebox[origin=c]{90}{ Lorem Ipsum }} &                    \\ \cline{1-1}
                                                                                      & \multirow{-9}{*}{ Dolor Sit Amet} \\ \cline{2-2}

\end{tabular}
\end{table}

\end{document}

这给了我不满意的结果。

有任何想法吗?

非常感谢您的耐心,

答案1

\documentclass[a4paper,12pt]{article}

\usepackage{array,multirow,graphicx}
\usepackage[table,xcdraw]{xcolor}

\begin{document}

\begin{table}[h]
\setlength{\arrayrulewidth}{2pt}
\begin{tabular}{l!{\vrule width 2pt}l|}
\hline
\multicolumn{1}{|l!{\vrule width 0.4pt}}{\cellcolor[HTML]{C0C0C0}\rotatebox[origin=c]{90}{%
\parbox{2cm}{\centering Lorem Ipsum }}} & \\ \cline{1-1}
                                            & \\
                                            & \\
                                            & \\
                                            & \\
                                            &
\multirow{-6}{*}{Dolor Sit Amet} \\[-2pt]\cline{2-2}

\end{tabular}
\end{table}

\end{document}

在此处输入图片描述

为了改变,tcolorbox

\documentclass[a4paper,12pt]{article}
\usepackage{kantlipsum}
\usepackage[most]{tcolorbox}
\definecolor{mycolor}{HTML}{C0C0C0}

\newtcolorbox{mytab}[1][]{
    colback=white,
    left=6pt,
    top=6pt,
    arc=6pt,
    outer arc=0pt,
    enlarge left by=\dimexpr1cm+6pt\relax,
    width=\dimexpr\textwidth-1cm-6pt\relax,
    nobeforeafter,
    frame hidden,
    enhanced jigsaw,
    overlay={
      \node[draw,fill=mycolor,anchor=south east,inner sep=4pt,align=center,
        ,minimum height=1cm,text width=1in,rotate=90] (a)
         at (frame.north west) {#1};
        \draw[line width=2pt] (a.south west) -| (a.north east) -- (frame.north east) |- ([xshift=-0.5\pgflinewidth]frame.south west) -- ([xshift=-0.5\pgflinewidth]a.south west) -- cycle;
    },
    before=\noindent%
  }

\begin{document}
\begin{mytab}[Lorem\\Ipsum]
\kant[1]
\end{mytab}

\end{document}

在此处输入图片描述

相关内容