3

I'm dealing with tables, I want to obtain a table like this:

Table Model

And I wrote this very basic code:

\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}

Which gives me an unsatisfactory result.

Any ideas?

Thank you very much for your patience,

  • So you need the thick and thin borders? – Werner Apr 3 '15 at 0:05
  • Do you want multi row in the second column? – user11232 Apr 3 '15 at 0:28
  • Dear @Werner, more than thick/thin borders, I need a multirow table as in the figure. – user51937 Apr 3 '15 at 8:08
4
\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}

enter image description here

For a change, with 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}

enter image description here

  • Dear @HarishKumar thank you very much for you answer. I don't know the tcolorbox package, I can see it's very powerful! Now I tried to compile the code you proposed, but it gives me this Error: Sorry for the basic question.. – user51937 Apr 3 '15 at 8:28
  • @user51937 Sorry I can't see the error in the link you provided. For the above code to compile, you need to have an up-to-date tex distribution. – user11232 Apr 3 '15 at 9:03
  • Thank you very mush @HarishKumar, I updated LateX and now it works very well! Thank you man! – user51937 Apr 4 '15 at 19:28
  • @user51937 You are welcome. :) – user11232 Apr 4 '15 at 22:53
  • Dear @HarishKumar, may I ask you something about the grey box positioning, please? – user51937 Apr 8 '15 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.