救命!我无法创建此表

救命!我无法创建此表

我正在寻找创建此表的方法

%\vspace*{0.3cm}
\begin{quadro}[!htbp]
    \begin{footnotesize}
        \captionsetup{textfont=bf, font=footnotesize, justification=centering}
        \caption {Maquinas, equipamentos, móveis e utensílios.} 
        \label{Tabela: Tabela maquinas e equipamentos}
        \vspace*{0.05cm}
        \footnotesize
        %\centering
        %\rowcolors[]{1}{white}{cyan}
        \begin{threeparttable}
            \centering
            \begin{tabular}{|>{\raggedright\arraybackslash}m{6mm} m{30mm}|P{15mm}|m{18mm}|m{18mm}|}\hline
                 \multicolumn{2}{|>{\centering\arraybackslash}m{36mm}|}{\textbf{DESCRIÇÃO}}& \multicolumn{1}{>{\centering\arraybackslash}m{15mm}|}{\textbf{QUANT.}}& \multicolumn{1}{>{\centering\arraybackslash}m{18mm}|}{\textbf{VALOR UND.}}& \multicolumn{1}{>{\centering\arraybackslash}m{18mm}|}{\textbf{VALOR TOTAL}} \\ \hline
                & Cadeira comum & 12 & R\$350,00    & R\$4.200,00       \\ \hline
                & Cadeira G     & 11 & R\$2.000,00  & R\$22.000,00      \\ \hline
                & Mesa reun     & 01 & R\$14.000,00 & R\$14.000,00      \\ \hline
            Cadeira comum   &           &           &           &       \\ \hline
                &           &           &           &       \\ \hline
                &           &           &           &       \\ \hline
                &           &           &           &       \\ \hline
                &           &           &           &       \\ \hline
                &           &           &           &       \\ 
                &           &           & Subtotal  &       \\ \hline
                \multicolumn{1}{|>{\centering\arraybackslash}m{6mm}|}{\textbf{*}}& \multicolumn{1}{>{\centering\arraybackslash}m{30mm}|}{\textbf{DESCRIÇÃO}}& \multicolumn{1}{>{\centering\arraybackslash}m{15mm}|}{\textbf{QUANT.}}& \multicolumn{1}{>{\centering\arraybackslash}m{18mm}|}{\textbf{VALOR UND.}}& \multicolumn{1}{>{\centering\arraybackslash}m{18mm}|}{\textbf{VALOR TOTAL}} \\ \hline
                &           &           &           &       \\ \hhline{|~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                \multirowcell{2}&           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ \hhline{~|----}
                &           &           &           &       \\ 
                &           &           & Subtotal  &       \\ \hline
            \end{tabular}
        \end{threeparttable}
        \vspace*{-0.2cm}
        \par
        \bigskip
        Fonte: Elaborado pelo autor (2021).
    \end{footnotesize}
\end{quadro}
\par

在此处输入图片描述

答案1

不太清楚您的问题是什么。因此,请将您的代码片段扩展为完整的可编译小文档(MWE:最小工作示例),就像此答案中所做的那样。还要用更多日期填充您的表格,特别是在第二部分。

无论如何,有一些建议,关于如何编写表格:

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{array, makecell, threeparttable}
\renewcommand\theadfont{\small\bfseries}%\uppercase
\renewcommand\theadgape{}
\NewExpandableDocumentCommand\mc{O{c|}m}{\multicolumn{1}{#1}{#2}}
\NewExpandableDocumentCommand\mcl{O{1}m}{\multicolumn{#1}{l|}{#2}}
\NewExpandableDocumentCommand\mcll{O{1}m}{\multicolumn{#1}{|l|}{#2}}
\usepackage{siunitx}

\begin{document}

\begin{table}[!htbp]
    \small
    \captionsetup{textfont=bf, font=footnotesize, justification=centering}
\caption {Maquinas, equipamentos, móveis e utensílios.}
\label{Tabela: Tabela maquinas e equipamentos}
%
\sisetup{group-four-digits,
         output-decimal-marker = {,}}
\setcellgapes{5pt}
\makegapedcells
    \begin{threeparttable}
\begin{tabular}{|l l |S[table-format=2]|S[table-format=5.2]|S[table-format=5.2]|}
    \hline
\mcll[2]{\thead{DESCRIÇÃO}}
                        & \mc{\thead{QUANT.}}
                                & \mc{\thead{VALOR\\ UND. (R\$)}}
                                            & \mc{\thead{VALOR\\ TOTAL (R\$)}} \\
    \hline
        & Cadeira comum & 12    &    350,00 &  4 200,00 \\ \hline
        & Cadeira G     & 11    &  2 000,00 & 22 000,00 \\ \hline
        & Mesa reun     & 01    & 14 000,00 & 14 000,00 \\ \hline
\makecell{Cadeira\\ comum}
        &               &       &           &           \\ \hline
\mcll[2]{Very very long text}
                        &       &           &           \\ \hline
        &               &       &           &           \\ \hline
        &               &       &           &           \\ \hline
        &               &       & Subtotal  &           \\
    \hline
\mcll{\thead{*}}
        & \thead{DESCRIÇÃO}
                        & \mc{\thead{QUANT.}}
                                & \mc{\thead{VALOR\\ UND. (R\$)}}
                                            & \mc{\thead{VALOR\\ TOTAL (R\$)}} \\
    \hline
\mcll{?}  & ???         &       &           &           \\ \cline{2-5}
\mcll{}   &             &       &           &           \\ \cline{2-5}
\mcll{}   &             &       &           &           \\ \cline{2-5}
\mcll{}   &             &       &           &           \\ \cline{2-5}
\mcll{}   &             &       & Subtotal  &           \\ \hline
    \end{tabular}
\begin{tablenotes}[flushright,para]
\item[] Fonte: Elaborado pelo autor (2021).
\end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

在此处输入图片描述

不过,我会考虑@Fran 的评论。在这种情况下,表格将具有更专业的外观,并且表格代码也更简单:

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{booktabs, makecell, threeparttable}
\renewcommand\theadfont{\small\bfseries}%\uppercase
\renewcommand\theadgape{}
\NewExpandableDocumentCommand\mc{O{1}m}{\multicolumn{#1}{c}{#2}}
\usepackage{siunitx}

\begin{document}

\begin{table}[!htbp]
    \small
    \captionsetup{textfont=bf, font=footnotesize, justification=centering}
\caption {Maquinas, equipamentos, móveis e utensílios.}
\label{Tabela: Tabela maquinas e equipamentos}
%
\sisetup{group-four-digits,
         output-decimal-marker = {,}}
\setcellgapes{2pt}
\makegapedcells
    \begin{threeparttable}
\begin{tabular}{l l S[table-format=2] S[table-format=5.2] S[table-format=5.2] }
    \toprule
\mc[2]{\thead{DESCRIÇÃO}}
                        & \mc{\thead{QUANT.}}
                                & \mc{\thead{VALOR\\ UND. (R\$)}}
                                            & \mc{\thead{VALOR\\ TOTAL (R\$)}} \\
    \midrule
        & Cadeira comum & 12    &    350,00 &  4 200,00 \\ 
        & Cadeira G     & 11    &  2 000,00 & 22 000,00 \\ 
        & Mesa reun     & 01    & 14 000,00 & 14 000,00 \\ 
\makecell{Cadeira\\ comum}   
        &               &       &           &           \\ 
\mc[2]{Very very long text}
                        &       &           &           \\ 
        &               &       &           &           \\ 
        &               &       &           &           \\
    \midrule 
        &               &       & Subtotal  &           \\
    \midrule[\heavyrulewidth]
\thead{*}
        & \thead{DESCRIÇÃO}
                        & \mc{\thead{QUANT.}}
                                & \mc{\thead{VALOR\\ UND. (R\$)}}
                                            & \mc{\thead{VALOR\\ TOTAL (R\$)}} \\
    \midrule
?       & ???           &       &           &           \\
        &               &       &           &           \\
        &               &       &           &           \\
    \midrule
        &               &       & Subtotal  &           \\ 
    \bottomrule
    \end{tabular}
\begin{tablenotes}[flushright,para]
\item[] Fonte: Elaborado pelo autor (2021).
\end{tablenotes}
    \end{threeparttable}
\end{table}
\end{document}

在此处输入图片描述

相关内容