单元格大小不同的表格

单元格大小不同的表格

我正在尝试制作一张看起来像附图中的桌子。我不太确定从哪里开始。

我想在 LaTeX 中重新创建的表格的图片来自我的笔记

答案1

使用nccmath包(用于fleq环境):

\documentclass{article}
\usepackage{multirow,tabularx}
\usepackage{nccmath}

\begin{document}
    \begin{center}
\abovedisplayskip=-2pt
\belowdisplayskip=-2pt
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\linewidth}{@{} c|c|c|>{\fleqn}X<{\endfleqn} @{}}
ORDER & ALL & REPEAT & Formula \\
\hline
\multirow{4}{*}{NO}& \multirow{4}{*}{NO}
    & NO    &   \begin{equation}
                \binom{n}{r} = \frac{n!}{(n-r)!r!}
                \end{equation}   \\
\cline{3-4}
    && YES  &   \begin{equation}
                \binom{n-1+r}{r} = \frac{n!-1+r}{(n-1)!r!}
                \end{equation}  \\
\hline
\multirow{4}{*}{NO}& \multirow{4}{*}{NO}
    & NO    &   \begin{equation}
                a^2 + b^2 = c^2
                \end{equation}   \\
\cline{3-4}
    && YES  &   \begin{equation}
                n^r
                \end{equation}  \\
\hline
\end{tabularx}
    \end{center}
\end{document}

在此处输入图片描述

答案2

以下 MWE 可以作为起点:

在此处输入图片描述

\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{array}
\begin{document}

\noindent
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\textwidth}{c|c|c|X}
ORDER & ALL & REPEAT & Formula \\
\hline
\multirow{4}{*}{NO}& \multirow{4}{*}{NO} & NO  & {\begin{flalign} a + b = c &&\end{flalign}} \\
\cline{3-4}
                   &                     & YES & {\begin{flalign} a + b + c + d = e &&\end{flalign}}\\
\hline
\end{tabularx}
\end{document}

答案3

下面是使用卡路里-包裹:

\documentclass[a4paper, 11pt]{article}
\usepackage{bm, calc, cals}
\usepackage{nccmath}
\let\nc=\nullcell
\let\sc=\spancontent

\begin{document}

\begin{calstable}
\colwidths{{60pt}{60pt}{60pt}{200pt}} % 4 colums
\makeatletter
\def\cals@framers@width{0.8pt}
\def\cals@framecs@width{0pt}
\cals@setpadding{Ag}
\cals@setcellprevdepth{Al}
\def\cals@cs@width{0.4pt}
\def\cals@rs@width{0.4pt}
\abovedisplayskip=-1pt
\belowdisplayskip=-1pt

% R1
\thead{\bfseries%
\brow
    \def\cals@cs@width{0.4pt}
    \def\cals@borderT{0pt}
    \setlength\cals@paddingL{0pt}
    \alignC\cell{ORDER}
    \cals@setpadding{Ag}
    \alignC\cell{ALL }
    \alignL\cell{REPEAT }
    \cell{Formula}
\erow
\mdseries
}
% R2
\brow
    \def\cals@borderT{0.4pt}
    \setlength\cals@paddingL{0pt}
    \nc{lrt}
    \cals@setpadding{Ag}
    \nc{lrt}
    \alignC\cell{\vfil NO}
    \alignC\cell{\vfil\begin{fleqn}[4pt]\begin{equation}
                    \binom{n}{r} = \frac{n!}{(n-r)!r!}
                      \end{equation}\end{fleqn}}
    \ht\cals@current@row=33pt
\erow
 %R3
\brow
    \setlength\cals@paddingL{0pt}
    \nc{lrb}\alignC\sc{\vfil NO}
    \cals@setpadding{Ag}
    \nc{lrb}\alignC\sc{\vfil NO}
    \alignC\cell{\vfil YES}
    \alignC\cell{\vfil\begin{fleqn}[4pt]\begin{equation}
                        \binom{n-1+r}{r} = \frac{n!-1+r}{(n-1)!r!}
                        \end{equation}\end{fleqn}}
    \ht\cals@current@row=33pt
\erow
% R4
\brow
    \setlength\cals@paddingL{0pt}
    \nc{lrt}
    \cals@setpadding{Ag}
    \nc{lrt}
    \alignC\cell{\vfil NO}
    \alignC\cell{\vfil\begin{fleqn}[4pt]\begin{equation}
                          a^2 + b^2 = c^2
                          \end{equation} \end{fleqn}}
    \ht\cals@current@row=33pt
\erow
% R5
\brow
    \setlength\cals@paddingL{0pt}
    \nc{lrb}\alignC\sc{\vfil NO}
    \cals@setpadding{Ag}
    \nc{lrb}\alignC\sc{\vfil NO}
    \alignC\cell{\vfil YES}
    \alignC\cell{\vfil\begin{fleqn}[4pt]\begin{equation}
                         n^r
                            \end{equation}\end{fleqn}}
    \ht\cals@current@row=33pt
\erow\makeatother

\end{calstable}

\end{document}

在此处输入图片描述

相关内容