代码审查:页面上的表格

代码审查:页面上的表格

在我正在处理的文档中,我试图将四个表格分组到一页上。但是,似乎我还没有一个,但是多种的我对表格工作原理的理解存在问题......

我试图简化文档中的代码以提出单独的问题,但如果您不确定第一行的问题是什么,这会有点困难。

因此,我恳请您帮助我检查下面的代码,并告诉我哪里做错了。更准确地说:

  • 为什么是表格1偏移到正确的,我该如何解决这个问题?(表格1与底部的页码不齐平。
  • 为什么其他表偏移到左边,我该如何解决这个问题?(表3与底部的页码不齐平或者右侧表格1以及表 2表 4不与表格1
  • 为什么是表3偏移到底部,我该如何解决这个问题?(应该平等表 2,不是吗?)
  • 我收到很多过满/欠满警告,所以显然我管理页面空间的想法是错误的;我做错了什么,我该如何修复?
  • 如果您发现任何其他问题,请随时指出。

文本区域的大小、表格的行数、\multicolumn行的存在等都是原始文档的因素。

抱歉,代码太长了,但我不知道如何才能进一步缩短代码,而不会丢失一些困扰我的输出工件。

仅供参考,我正在使用latexmk -pdflatexmk 版本 4.35、TeXLive 2013 进行编译。

\documentclass[paper=a4,fontsize=10pt,pagesize=auto,twocolumn,open=any]{scrbook}

% Somewhat skewed textarea size, but that's how the document is.
\areaset[2.5cm]{16cm}{25.25cm}
\setlength{\columnsep}{2pc}

\usepackage{tabularx}
\usepackage[vlines]{tabularht}
\usepackage{multirow}
\newcolumntype{C}{>{\centering\arraybackslash}X}    % centered to-width
\newcolumntype{L}{>{\raggedright\arraybackslash}X}  % left-aligned to-width
\setkomafont{caption}{\Large} % large table captions
\usepackage{calc}             % inline calculations

% Artifact from some other tabularhtx use in the document --
% tabularhtx does not consider the height of the caption,
% so "\textheight" gives a too-high table. Funny enough, if
% I *reduce* the height of the outermost table, e.g. to
% 0.8\TabularHTHeight, table 3 gets **more** offset towards
% the bottom...?!?
\newlength{\TabularHTHeight}
\setlength{\TabularHTHeight}{\textheight - 1.0cm}

% Page layout
\usepackage{scrpage2}
\pagestyle{scrheadings}

\begin{document}

% Again, this is just the way the document is set up.
\fontsize{10pt}{11pt}
\selectfont

% Page number in a little box at the bottom of the page.
\rofoot{\fbox{\rightmark\hspace{14pt}\pagemark}}

% One table environment for the whole page
\begin{table*}
% One full-height, full-width tabular environment, two columns, no padding
\begin{tabularhtx}{\TabularHTHeight}{\linewidth}{@{}C@{}C@{}}
% One two-column (i.e. full-width) tabular environment
\multicolumn{2}{c}{\begin{tabularx}{\textwidth}{|lLLLLLLLLL|}
\noalign{%
\caption{Table 1}%
}
\hline
\multicolumn{10}{|p{\textwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
\hline
\end{tabularx}}\\
% First of two tables in the *left* column under table 1
\begin{tabularx}{\columnwidth}{|cLLLLL|}
\noalign{%
\caption{Table 2}%
}
\hline
\multicolumn{6}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
\hline
% One table in the *right* column under table 1
\end{tabularx} & \multirow{2}{*}{\begin{tabularx}{\columnwidth}{|lLLL|}
\noalign{%
\caption{Table 3}%
}
\hline
\multicolumn{4}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
\hline
\end{tabularx}}\\
% The second of the two tables in the *left* column
\begin{tabularx}{\columnwidth}{|cLLLLL|}
\noalign{%
\caption{Table 4}%
}
\hline
\multicolumn{6}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
\hline
\end{tabularx} & \\
\end{tabularhtx}
\end{table*}

\end{document}

答案1

给你:

% arara: pdflatex

\documentclass[paper=a4,fontsize=10pt,pagesize=auto,twocolumn,open=any]{scrbook}

% Somewhat skewed textarea size, but that's how the document is.
\areaset[2.5cm]{16cm}{25.25cm}
\setlength{\columnsep}{2pc}

\usepackage{tabularx}
\usepackage[vlines]{tabularht}
\usepackage{multirow}
\newcolumntype{C}{>{\centering\arraybackslash}X}    % centered to-width
\newcolumntype{L}{>{\raggedright\arraybackslash}X}  % left-aligned to-width
\setkomafont{caption}{\Large} % large table captions
\usepackage{calc}             % inline calculations

% Artifact from some other tabularhtx use in the document --
% tabularhtx does not consider the height of the caption,
% so "\textheight" gives a too-high table. Funny enough, if
% I *reduce* the height of the outermost table, e.g. to
% 0.8\TabularHTHeight, table 3 gets **more** offset towards
% the bottom...?!?
\newlength{\TabularHTHeight}
\setlength{\TabularHTHeight}{\textheight - 1.0cm}

% Page layout
\usepackage{scrpage2}
\pagestyle{scrheadings}

\begin{document}

    % Again, this is just the way the document is set up.
    \fontsize{10pt}{11pt}
    \selectfont

    % Page number in a little box at the bottom of the page.
    \rofoot{\fbox{\rightmark\hspace{14pt}\pagemark}}

    % One table environment for the whole page
    \begin{table*}
        % One full-height, full-width tabular environment, two columns, no padding
        \begin{tabularhtx}{\TabularHTHeight}{\textwidth}{@{}C@{}C@{}}
            % One two-column (i.e. full-width) tabular environment
            \multicolumn{2}{@{}c@{}}{\begin{tabularx}{\textwidth}{|lLLLLLLLLL|}
                    \noalign{%
                        \caption{Table 1}%
                    }
                    \hline
                    \multicolumn{10}{|p{\textwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    &  &  &  &  &  &  &  &  & \\
                    \hline
                \end{tabularx}}\\
                % First of two tables in the *left* column under table 1
                \begin{tabularx}{\linewidth}[t]{|cLLLLL|}
                    \noalign{%
                        \caption{Table 2}%
                    }
                    \hline
                    \multicolumn{6}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    &  &  &  &  & \\
                    \hline
                    % One table in the *right* column under table 1
                \end{tabularx}              
                %
                \begin{tabularx}{\linewidth}[t]{|cLLLLL|}
                \noalign{%
                    \caption{Table 4}%
                }
                \hline
                \multicolumn{6}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                &  &  &  &  & \\
                \hline
            \end{tabularx} & \begin{tabularx}{\linewidth}[t]{|lLLL|}
                    \noalign{%
                        \caption{Table 3}%
                    }
                    \hline
                    \multicolumn{4}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                &  &  & \\
                \hline
            \end{tabularx}
        \end{tabularhtx}
    \end{table*}        
\end{document}

在此处输入图片描述


我使用这个包是showframe为了显示页面设置的所有限制。右边距不适合页面。我猜,这就是所有框都满的原因。你应该试着去掉边距或让它变薄。或者你根本就不在乎它。我不知道你的文档会是什么样子……

答案2

这不是“这里有解决办法”。它更接近于带有一些解释和选项的部分解决方案。

multirow根据当前行垂直居中。因此,表格 3 的顶部与表格 2 的垂直中心对齐。如文档所述,fixup当垂直尺寸关闭时,您可以使用参数来适应这种情况。我不会那样做,而是将表格 2 和 4 放在由单列组成的表格中。这样,表格 3 将与该表格环境垂直对齐。但是,这将是垂直中心。由于左侧表格将包含额外的标题行,如果您想要表格 2 和 3 的顶部和/或表格 4 和 3 的底部对齐,则需要考虑到这一点。由于不了解上下文,我没有这样做。为了获得正确的水平对齐方式,我使用了,{@{}C}因为您希望右侧有一些列间空间(否则一方面表格 2 和 4 与另一方面表格 3 之间没有间隙),但左侧不需要。

当您使用 时\multicolumn,您必须重申列每一侧的任何所需代码。例如,如果您使用垂直规则,并且希望这些规则继续延伸到多列的两侧,您需要说{|c|},例如,即使表格定义中最左边和最右边的列本身包含垂直规则。因此,如果您最初的设置将列间距设置为零,则需要在多列的定义中重复此操作,如果您希望水平对齐。也就是说,您需要\multicolumn{2}{@{}c@{}}{...}而不是\multicolumn{2}{c}。这是常规的列间距,否则会导致表 1 相对于表 2 和 4 水平移动。

最后,我想你的意思是,你\linewidth不是\columnwidth在重新引入没有考虑到的水平空间。

\documentclass[paper=a4,fontsize=10pt,pagesize=auto,twocolumn,open=any]{scrbook}
% Somewhat skewed textarea size, but that's how the document is.
\areaset[2.5cm]{16cm}{25.25cm}
\setlength{\columnsep}{2pc}

\usepackage{tabularx}
\usepackage[vlines]{tabularht}
\usepackage{multirow}
\newcolumntype{C}{>{\centering\arraybackslash}X}    % centered to-width
\newcolumntype{L}{>{\raggedright\arraybackslash}X}  % left-aligned to-width
% \setkomafont{caption}{\Large} % large table captions
\usepackage{calc}             % inline calculations

% Artifact from some other tabularhtx use in the document --
% tabularhtx does not consider the height of the caption,
% so "\textheight" gives a too-high table. Funny enough, if
% I *reduce* the height of the outermost table, e.g. to
% 0.8\TabularHTHeight, table 3 gets **more** offset towards
% the bottom...?!?
\newlength{\TabularHTHeight}
\setlength{\TabularHTHeight}{\textheight - 1.0cm}

% Page layout
\usepackage{scrpage2}
\pagestyle{scrheadings}

\begin{document}

% % Again, this is just the way the document is set up.
\fontsize{10pt}{11pt}
\selectfont

% % Page number in a little box at the bottom of the page.
\rofoot{\fbox{\rightmark\hspace{14pt}\pagemark}}

% One table environment for the whole page
\begin{table*}
% One full-height, full-width tabular environment, two columns, no padding
  \begin{tabularhtx}{\TabularHTHeight}{\linewidth}{@{}C@{}C@{}}
  % One two-column (i.e. full-width) tabular environment
    \multicolumn{2}{@{}c@{}}{%
      \begin{tabularx}{\linewidth}{|l*{9}{L}|}
        \noalign{%
        \caption{Table 1}%
        }
        \hline
        \multicolumn{10}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        &  &  &  &  &  &  &  &  & \\
        \hline
      \end{tabularx}%
    }\\
\begin{tabularx}{\linewidth}{@{}C}
      % First of two tables in the *left* column under table 1
      {\begin{tabularx}{\linewidth}{|c*{5}{L}|}
        \noalign{%
        \caption{Table 2}%
        }
        \hline
        \multicolumn{6}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        \hline
      \end{tabularx}}\\
      % The second of the two tables in the *left* column
      {\begin{tabularx}{\linewidth}{|c*{5}{L}|}
        \noalign{%
        \caption{Table 4}%
        }
        \hline
        \multicolumn{6}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        &  &  &  &  & \\
        \hline
      \end{tabularx}}\\
    \end{tabularx}
    % One table in the *right* column under table 1
    & \begin{tabularx}{\linewidth}{|l*{3}{L}|}
        \noalign{%
        \caption{Table 3}%
        }
        \hline
        \multicolumn{4}{|p{\linewidth - 2\tabcolsep - 2\fboxrule}|}{}\\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        &  &  & \\
        \hline
      \end{tabularx}\\
  \end{tabularhtx}
\end{table*}

\end{document}

对齐表格 - 或多或少

答案3

这两个答案都很有帮助。通过结合两者的元素,再加上我自己的修复,我得到了我想要的布局。

用户 cfr 指出了\multicolumn用户 cfr 指出了for表格1破坏了它的对齐。给予\multicolumn{2}{@{}c@{}}修复了这个问题。

用户 cfr 还解释了垂直对齐的工作原理\multirow,谢谢。用户 LaRiFaRi[t]针对相应\tabularx环境提供了一个非常简单的解决方案。

\columnwidth用户 cfr 还对vs发表了评论\linewidth,这为我指明了正确的方向。我希望表格 2-4 用 分隔\columnsep,即与其他页面上的文本列相隔尽可能远。(抱歉,我在问题中没有把这一点说清楚。)但是,强制表格 用 分隔是\columnwidth错误的做法。在替换\columnwidth为之后\linewidth(按照 cfr 的建议),我得到了未分隔的表格,就像 LaRiFaRi 的示例一样。

tabularhtx将环境从改变@{}C@{}C@{}@{}C@{\hspace{\columnsep}}C@{}则给了我所寻求的分离。

固定布局

我仍然会收到 vbox 过满/未满警告,但稍后会修复这些问题,也许会提出不同的问题。表格布局的大问题已修复。

感谢两位用户。用户 cfr 的解释对我帮助很大,所以我将赏金分配给了他。(我宁愿分摊,但……算了。)


更新:

为了消除过满/不足警告,并发现似乎\interrowfill无法与 正确结合使用\multirow,我提出了第二个问题(现已删除)。David Carlisle 表达了对我tabularhtx最初使用的整体结构的不满,并指出了minipage解决方案。我最终找到了答案。这是包含所有改进的示例表:

% Inside the table, \columnwidth doesn't really work, so we save its value.
\newlength{\colwidth}
\setlength{\colwidth}{\columnwidth}

\begin{table*}
% minipage for table at the top
\begin{minipage}[t]{\linewidth}
\begin{tabularx}{\textwidth}{|lLLLLLLLLL|}
\noalign{%
\caption{Table 1}%
}
\hline
\multicolumn{10}{|p{\textwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
 &  &  &  &  &  &  &  &  & \\
\hline
\end{tabularx}

% minipage for the two tables in the left column (note \colwidth)
\begin{minipage}[t]{\colwidth}
% first left-column page
\begin{tabularx}{\linewidth}{|cLLLLL|}
\noalign{%
\caption{Table 2}%
}
\hline
\multicolumn{6}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
\hline

% second left-column page
\begin{tabularx}{\linewidth}{|cLLLLL|}
\noalign{%
\caption{Table 4}%
}
\hline
\multicolumn{6}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
 &  &  &  &  & \\
\hline
\end{tabularx}
\end{minipage}
% now add second minipage for the right-hand column
% the \hfill will place the minipage right-bound in the textarea
% since we are using the original \columnwidth for each minipage
% the separating space will be "just right"
\hfill
\begin{minipage}[t]{\colwidth}
\begin{tabularx}{\columnwidth}{|lLLL|}
\noalign{%
\caption{Table 3}%
}
\hline
\multicolumn{4}{|p{\columnwidth - 2\tabcolsep - 2\fboxrule}|}{}\\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
 &  &  & \\
\hline
\end{tabularx}
\end{minipage}
\end{table*}

布局相同,没有警告。仍然不包括(相当于)\interrowfill,但对我来说这当然“足够好”,因为内容无论如何都会填满页面到一行之内。

相关内容