1

the following tex code creates a 3x3 table, where each of the first two rows are merged into one cell. Each of the first two rows is populated by another 3x3 table. I'm struggling because of underlining of various cells. Underlining in tables within a given cell does not span out as long as underlining in the original bigger table. I'm curious if there is a way for the table within a cell to proportionally max out the cell. I'm aware my question might be a bit unclear, and I apologize. I'd be glad to explain further if you can kindly ask. Thank you!

%2multibyte Version: 5.50.0.2960 CodePage: 1252
\documentclass{article}%
\usepackage{amsmath}%
\setcounter{MaxMatrixCols}{30}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{Codepage=1252}
%TCIDATA{CSTFile=40 LaTeX article.cst}
%TCIDATA{Created=Tuesday, September 26, 2023 01:00:32}
%TCIDATA{LastRevised=Tuesday, September 26, 2023 01:04:30}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{<META NAME="DocumentShell" CONTENT="Standard LaTeX\Blank - Standard LaTeX Article">}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\newtheorem{theorem}{Theorem}
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{case}[theorem]{Case}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\begin{document}
%
\begin{tabular}
[c]{lll}%
\multicolumn{3}{l}{%
\begin{tabular}
[c]{lll}
&  & \\
rtyu & fghj & vbnm\\\hline
qwer & asdf & zxcv\\\hline
\end{tabular}
}\\
\multicolumn{3}{l}{%
\begin{tabular}
[c]{lll}
&  & \\
rtyu & fghj & vbnm\\\hline
qwer & asdf & zxcv
\end{tabular}
}\\\cline{1-3}%
qwer & asdf & zxcv\\\hline
\end{tabular}

\end{document}

2 Answers 2

1

You need to change both instances of

\multicolumn{3}{l}{%

to

\multicolumn{3}{@{}l@{}}{%

in order to suppress the automatic application of whitespace padding on both sides of the single l column.

An additional comment: I don't know if having the same column widths apply to the two "inner" tabular environments as to the outer one is important to you. If it is, I would recommend loading the array package and using a fixed-width column type with a set width, say w{l}{1in} or p{1in}, instead of the basic l column type, for both of the inner tabular environments as well as for the outer tabular environment.

enter image description here

\documentclass{article}

\begin{document}

\begin{tabular}{lll}%
\hline % <-- new
\multicolumn{3}{@{}l@{}}{% % suppress whitespace padding
    \begin{tabular}{lll}
    &  & \\
    rtyu & fghj & vbnm\\ \hline
    qwer & asdf & zxcv\\ 
    \end{tabular}
    }\\
\hline
\multicolumn{3}{@{}l@{}}{%
    \begin{tabular}{lll}
    &  & \\
    rtyu & fghj & vbnm\\ \hline
    qwer & asdf & zxcv
    \end{tabular}
    }\\
\cline{1-3}% % why not write "\hline"? 
qwer & asdf & zxcw\\
\hline
\end{tabular}

\end{document}
1

I can't figured out why you nested tables. The same result you can get with simple one table:


\documentclass{article}%

\begin{document}
%
\begin{tabular}{lll}
\hline
    &  & \\
    rtyu & fghj & vbnm\\    \hline
    qwer & asdf & zxcv\\    
\hline
    &  & \\
    rtyu & fghj & vbnm\\    \hline
    qwer & asdf & zxcv\\    
\hline
    qwer & asdf & zxcv\\    
\hline
\end{tabular}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .