1

I would like to nest two boxes in my table. It looks like this:

 content      content      content      content      content
            +----------------------+
 content    | content      content |    content      content
            |+--------------------+|
 content    ||content      content||    content      content
            |+--------------------+|
 content    | content      content |    content      content
            +----------------------+
 content      content      content      content      content

I looked at Framing cells in a table which provides a good solution, but the main issue is that I can't set the length of the horizontal line in the inner box. \cline{2-3} always produces the same width. It would produce something that looks like this:

 content      content      content      content      content
            +----------------------+
 content    | content      content |    content      content
            ++--------------------++
 content    ||content      content||    content      content
            ++--------------------++
 content    | content      content |    content      content
            +----------------------+
 content      content      content      content      content

But I would like to avoid the inner box from intersecting with / joining the outer box.

  • 1
    You should rather show the code so far instead of a an ASCII-ART like image ;-) – user31729 Feb 2 '16 at 16:51
  • Using matrix from TikZ is probably the simplest way to achieve this. – Zarko Feb 2 '16 at 17:05
3

For exercises and starting point:

enter image description here

\documentclass[border=3mm,
               tikz,
               preview
               ]{standalone}
\usetikzlibrary{fit,
                matrix,
                }

\begin{document}   
\begin{tikzpicture}[
every node/.style = {inner sep=0.5mm}
                    ]
\matrix (magic) [matrix of nodes,
                 column sep=1.5mm,
                 row sep=1.5mm]
{
content & content & content & content & content \\
content & content & content & content & content \\
content & content & content & content & content \\
content & content & content & content & content \\
content & content & content & content & content \\
};
\node (a) [draw, fit=(magic-3-2) (magic-3-3)] {};
\node (b) [draw, fit=(magic-2-2) (a) (magic-4-3)] {};
\end{tikzpicture}
    \end{document}

How to do this in your table? First you need to provide complete document with your table, that I can see, what can be done. Above image only replicate your image in question :-)

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.