longtable 的工作位置标签如何?

longtable 的工作位置标签如何?

2.问题:

  1. 如何将“续表”和 \caption 文本左对齐?在这种情况下 \raggedright 不起作用。
  2. 如何删除枚举器前的空行?

源代码:

\documentclass{article}

\usepackage{longtable}
\usepackage{array}

\title{A longtable example}

\begin{document}
\begin{longtable}{| >{\raggedright}p{0.20\linewidth} 
                  | >{\raggedright}p{0.28\linewidth} 
                  | >{\raggedright}p{0.28\linewidth} 
                  | >{\raggedright\arraybackslash}p{0.12\linewidth}|}
   \caption{A sample long table.} \label{tab:long} \\


   First column & First column & First column & First column \\
   \endfirsthead

\multicolumn{3}{c}%
{{ \raggedleft \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{|c|}{{First column}} & \multicolumn{1}{c|}{{Second column}} & \multicolumn{1}{c|}{{Third column}} & \multicolumn{1}{c|}{{Third column}} \\ \hline 
\endhead
   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
    Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
   Login-1 & \begin{enumerate}
                \item[1)] step1;
                \item[2)] step2;
            \end{enumerate}
             & Doing something & yes \\

   \hline
  \end{longtable}

\end{document}

答案1

\multicolumn{3}{c}%
{{ \raggedleft \tablename\ \thetable{} -- continued from previous page}} \\

c是一个水平框,\mbox因此段落设置\raggedleft无效,你大概想要

\multicolumn{3}{r}%
{\tablename\ \thetable{} -- continued from previous page} \\

获得齐平的右侧入口。

相关内容