表格问题——额外的列

表格问题——额外的列

当我尝试制作表格时 - 它不会创建第四列。我的序言如下所示:

\documentclass[a4paper,11pt,oneside]{article}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry}
\usepackage{array}
\usepackage{booktabs,threeparttable}
\newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}} % handy shortcut macro
\renewcommand{\TPTnoteSettings}{\footnotesize}
\renewcommand{\TPTnoteLabel}[1]{#1}
\begin{document}
\begin{table}[H]
\begin{threeparttable}
\renewcommand\arraystretch{1.1}
%\renewcommand\tabcolsep{1pt}
\begin{tabular}{@{}>{\centering}p{0.15\textwidth}>{\raggedright}m{0.68\textwidth}
    p{\dimexpr0.17\textwidth-4\tabcolsep\relax}@{}}
\toprule
\mc{Name Number}& \mc{Hyp} & \mc{OneTwo} & \mc{ThreeFour}  \\
\midrule
1 & TEXT TEXT TEXT  TEXT TEXT TEXT  TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT  TEXT TEXT TEXT  & FALSIFY & SATISFY \\
2 & TEXT TEXT TEXT  TEXT TEXT TEXT  TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT  TEXT TEXT TEXT  & FALSIFY & SATISFY \\
3 & TEXT TEXT TEXT  TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT  TEXT TEXT TEXT  TEXT TEXT TEXT  & FALSIFY & SATISFY \\
4 & TEXT TEXT TEXT  TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT  TEXT TEXT TEXT  TEXT TEXT TEXT  & FALSIFY & SATISFY \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\vspace{-0.6em}
\end{document}

我的数字看起来像这样(我希望“ThreeFour”列与“Name Number”、“Hyp”和“OneTwo”位于同一行:

在此处输入图片描述

答案1

需要添加额外的列,每列都必须明确声明。

空格已根据示例进行了调整,您必须在实际表格中对其进行调整。

我删除了一些我认为不好的东西。

表格扩展列

\documentclass[a4paper,11pt,oneside]{article}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry}
\usepackage{array}
\usepackage{showframe}
\usepackage{booktabs,threeparttable}
\def\blindtext{
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam
    lobortis facilisis sem. Nullam nec mi et neque pharetra
    sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper,
    felis non sodales commodo, lectus velit ultrices augue, a
    dignissim nibh lectus placerat pede. Vivamus nunc nunc, molestie
    ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in
}
\begin{document}
\begin{table}%[H]
    \begin{threeparttable}
        \renewcommand\arraystretch{1.1}
        \begin{tabular}{
>{\centering}p{0.16\textwidth}
>{\raggedright\arraybackslash}m{0.45\textwidth}
>{\centering\arraybackslash}p{.13\textwidth}
>{\centering\arraybackslash}p{.13\textwidth}
}
            \toprule
            \centering Name Number& \centering Hyp & \centering OneTwo & \centering ThreeFour  \tabularnewline
            \midrule
            1 & \blindtext& FALSIFY & SATISFY \\\addlinespace
            2 & \blindtext& FALSIFY & SATISFY \\
            \bottomrule
        \end{tabular}
    \end{threeparttable}
\end{table}
 \end{document}

根据您的实际文档,您可能需要查看一下tabularx

\documentclass[a4paper,11pt,oneside]{article}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[left=3.0cm,right=3.0cm,top=3.0cm,bottom=3.0cm]{geometry}
\usepackage{array}
%\usepackage{showframe}
\usepackage{booktabs,tabularx}
\def\blindtext{
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam
    lobortis facilisis sem. Nullam nec mi et neque pharetra
    sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper,
    felis non sodales commodo, lectus velit ultrices augue, a
    dignissim nibh lectus placerat pede. Vivamus nunc nunc, molestie
    ut, ultricies vel, semper in, velit. Ut porttitor. Praesent in
}
\begin{document}
\begin{table}%[H]
    \begin{tabularx}{\textwidth}{c>{\raggedright}Xcc}
            \toprule
             Name Number&  Hyp &  OneTwo &  ThreeFour  \\
            \midrule
            1 & \blindtext& FALSIFY & SATISFY \\\addlinespace
            2 & \blindtext& FALSIFY & SATISFY \\
            \bottomrule
        \end{tabularx}
\end{table}
\end{document}

相关内容