Tabularx:将长表格分成几页

Tabularx:将长表格分成几页

我正在制作一张长表,用于修改我的论文。这将是一张非常长的表格,以下是我目前所拥有的内容:

\documentclass[12pt]{article}

\usepackage{mathptmx}%
\usepackage{tabularx}
\usepackage{color}


    \begin{document}

    This document is a list of changes made according to the requests for both examiners. Texts in black are the requested items from examiners, while texts in \textcolor{blue}{blue} are the amened items. Pages refer to the page number on which these requested items are in both the original document and \textcolor{blue}{amended document}.\\
    \newline
    \newline
    \begin{center}
    \begin{tabularx}{\linewidth}{ c | X }


    \multicolumn{2}{c}{\textbf{Changes Required from Examiner A}} \\
    \hline
    \hline
    \textbf{\textit{page}} & \textbf{\textit{Content}} \\
    \hline

       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any
    elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \hline

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:
    3.1 Laboratory Flat Bed Wave Flume Test , 
    3.2 Field Scale Flat Bed Test ,
    3.3 Field Scale Flat Bed Test using IHFOAM ,
    3.4 Field Scale Flat Bed Test using FoamExtend ,
    3.5 Field Scale Flat Bed Test using Different Wave Parameters , 
    4 Continental Shelf Scale Simulation Series ,
    4.1 Continental Shelf Scale Test with A Constant Slope , 
    4.2 Continental Shelf Scale Test Validation  ,
    4.2.1
    Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,
    4.2.2 Flat Bed Continental Shelf Scale Test ,
    4.2.3 Continental Shelf Scale Test with Fluid Viscosity.} \\
    & \\   
    \hline    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is
    ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \hline
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    

    \end{tabularx}

    \end{center}
    \end{document}

最终产品 在此处输入图片描述

当当前页面已满时,有没有什么方法可以在页面末尾自动拆分此表并继续到下一页?

答案1

longtable如果要保留该X列,则不能使用该包。因此,您可以使用ltablex

表列

\documentclass[12pt]{article}

\usepackage{mathptmx}%
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{color}


    \begin{document}

    This document is a list of changes made according to the requests for both examiners. Texts in black are the requested items from examiners, while texts in \textcolor{blue}{blue} are the amened items. Pages refer to the page number on which these requested items are in both the original document and \textcolor{blue}{amended document}.\\
    \newline
    \newline
    \begin{center}
    \begin{tabularx}{\linewidth}{ c | X }


    \multicolumn{2}{c}{\textbf{Changes Required from Examiner A}} \\
    \hline
    \hline
    \textbf{\textit{page}} & \textbf{\textit{Content}} \\
    \hline

       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any
    elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \hline

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:
    3.1 Laboratory Flat Bed Wave Flume Test , 
    3.2 Field Scale Flat Bed Test ,
    3.3 Field Scale Flat Bed Test using IHFOAM ,
    3.4 Field Scale Flat Bed Test using FoamExtend ,
    3.5 Field Scale Flat Bed Test using Different Wave Parameters , 
    4 Continental Shelf Scale Simulation Series ,
    4.1 Continental Shelf Scale Test with A Constant Slope , 
    4.2 Continental Shelf Scale Test Validation  ,
    4.2.1
    Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,
    4.2.2 Flat Bed Continental Shelf Scale Test ,
    4.2.3 Continental Shelf Scale Test with Fluid Viscosity.} \\
    & \\   
    \hline    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is
    ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \hline
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    
       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any
    elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \hline

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:
    3.1 Laboratory Flat Bed Wave Flume Test , 
    3.2 Field Scale Flat Bed Test ,
    3.3 Field Scale Flat Bed Test using IHFOAM ,
    3.4 Field Scale Flat Bed Test using FoamExtend ,
    3.5 Field Scale Flat Bed Test using Different Wave Parameters , 
    4 Continental Shelf Scale Simulation Series ,
    4.1 Continental Shelf Scale Test with A Constant Slope , 
    4.2 Continental Shelf Scale Test Validation  ,
    4.2.1
    Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,
    4.2.2 Flat Bed Continental Shelf Scale Test ,
    4.2.3 Continental Shelf Scale Test with Fluid Viscosity.} \\
    & \\   
    \hline    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is
    ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \hline
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    

    \end{tabularx}

    \end{center}
    \end{document}

但您也可以考虑booktabs另外使用并使您的桌子看起来美观。

更好的风格

\documentclass[12pt]{article}

\usepackage{mathptmx}%
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{booktabs}
\usepackage{color}


    \begin{document}

    This document is a list of changes made according to the requests for both examiners. Texts in black are the requested items from examiners, while texts in \textcolor{blue}{blue} are the amened items. Pages refer to the page number on which these requested items are in both the original document and \textcolor{blue}{amended document}.\par
    \renewcommand{\arraystretch}{1.4}
    \begin{tabularx}{\linewidth}{ c X }
    \caption{Changes Required from Examiner A}\\\toprule\endfirsthead
    \toprule\endhead
    \midrule\multicolumn{2}{r}{\itshape continues on next page}\\\midrule\endfoot
    \bottomrule\endlastfoot
    \textbf{page} & \textbf{Content} \\\midrule

       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any
    elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \midrule

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:
    3.1 Laboratory Flat Bed Wave Flume Test , 
    3.2 Field Scale Flat Bed Test ,
    3.3 Field Scale Flat Bed Test using IHFOAM ,
    3.4 Field Scale Flat Bed Test using FoamExtend ,
    3.5 Field Scale Flat Bed Test using Different Wave Parameters , 
    4 Continental Shelf Scale Simulation Series ,
    4.1 Continental Shelf Scale Test with A Constant Slope , 
    4.2 Continental Shelf Scale Test Validation  ,
    4.2.1
    Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,
    4.2.2 Flat Bed Continental Shelf Scale Test ,
    4.2.3 Continental Shelf Scale Test with Fluid Viscosity.} \\
    & \\   
    \midrule    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is
    ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \midrule
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    
       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any
    elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \midrule

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:
    3.1 Laboratory Flat Bed Wave Flume Test , 
    3.2 Field Scale Flat Bed Test ,
    3.3 Field Scale Flat Bed Test using IHFOAM ,
    3.4 Field Scale Flat Bed Test using FoamExtend ,
    3.5 Field Scale Flat Bed Test using Different Wave Parameters , 
    4 Continental Shelf Scale Simulation Series ,
    4.1 Continental Shelf Scale Test with A Constant Slope , 
    4.2 Continental Shelf Scale Test Validation  ,
    4.2.1
    Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,
    4.2.2 Flat Bed Continental Shelf Scale Test ,
    4.2.3 Continental Shelf Scale Test with Fluid Viscosity.} \\
    & \\   
    \midrule    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is
    ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \midrule
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    
    \end{tabularx}
    \end{document}

答案2

使用xltabular。它定义了一个环境xltabular- 根据手册并且tabularx与导入后的环境不同ltablex- 其行为与 相同tabularx。特别是,您可以itemize在单元格中使用。

答案3

使用对于长表格内容很有用的 longtable 包,并使用命令\endhead在每个新页面中重复表格的标题。

\documentclass[12pt]{article}
\usepackage[top=0.5cm,bottom=1.4cm,left=1.0cm,right=0.2cm]{geometry}
\usepackage{mathptmx}%
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

    \begin{document}

    This document is a list of changes made according to the requests for both examiners. Texts in black are the requested items from examiners, while texts in \textcolor{blue}{blue} are the amened items. Pages refer to the page number on which these requested items are in both the original document and \textcolor{blue}{amended document}.\\
    \newline
    \newline
    %\begin{center}
    \begin{longtable}{ C{2cm} | L{16cm} }


    \multicolumn{2}{c}{\textbf{Changes Required from Examiner A}} \\
    \hline
    \hline
    \textbf{\textit{page}} & \textbf{\textit{Content}} \\\hline \endhead
    \hline

       i & A good English speaker should look at the title, the Abstract, and Introduction and eliminate any elementary mistakes of no/definite/indefinite article, subject/verb agreement.\\
    & \\
       \textcolor{blue}{i} & \textcolor{blue}{All grammar has been checked.} \\
       & \\
    \hline

    N/A & The candidate should consider all titles of sections that are uninformative to any other reader, such as 4.2 Test WaveFlume, 4.3 Test Fiel\_H5\_T10, 4.4 Test Field\_IHFOAM, 4.5 Test Field\_Extend, 4.6
    Test Field\_H2\_T20, 5.1 Test\_SHORELINE. They are all meaningless, except to the person who has
    done the work. I strongly suggest something like “Flat bed, single water layer", "Flat bed, water
    layer and air layer", and so on.   \\
    & \\
     \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:}\\
   & 3.1 Laboratory Flat Bed Wave Flume Test , \\
   & 3.2 Field Scale Flat Bed Test ,\\
   & 3.3 Field Scale Flat Bed Test using IHFOAM ,\\
   & 3.4 Field Scale Flat Bed Test using FoamExtend ,\\
   & 3.5 Field Scale Flat Bed Test using Different Wave Parameters , \\
   & 4 Continental Shelf Scale Simulation Series ,\\
   & 4.1 Continental Shelf Scale Test with A Constant Slope , \\
   & 4.2 Continental Shelf Scale Test Validation  ,\\
   & 4.2.1 Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,\\
   & 4.2.2 Flat Bed Continental Shelf Scale Test ,\\
   & 4.2.3 Continental Shelf Scale Test with Fluid Viscosity. \\
    & \\   
    \hline    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \hline
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    
       \textcolor{blue}{N/A} & \textcolor{blue}{All titles have been changed accordingly as follows:}\\
   & 3.1 Laboratory Flat Bed Wave Flume Test , \\
   & 3.2 Field Scale Flat Bed Test ,\\
   & 3.3 Field Scale Flat Bed Test using IHFOAM ,\\
   & 3.4 Field Scale Flat Bed Test using FoamExtend ,\\
   & 3.5 Field Scale Flat Bed Test using Different Wave Parameters , \\
   & 4 Continental Shelf Scale Simulation Series ,\\
   & 4.1 Continental Shelf Scale Test with A Constant Slope , \\
   & 4.2 Continental Shelf Scale Test Validation  ,\\
   & 4.2.1 Continental Shelf Scale Test with A Varying Cell Thickness in Wave Propagating
    Direction ,\\
   & 4.2.2 Flat Bed Continental Shelf Scale Test ,\\
   & 4.2.3 Continental Shelf Scale Test with Fluid Viscosity. \\
    & \\   
    \hline    
      N/A & The candidate should insert dimensionless wave parameters wherever a wave is described, e.g. 1
    m, 10 s waves. I would prefer using wavelength, such as using values of $H/L$ and $L/d$, but the
    candidate might prefer to use $gT^2$ as a length scale. I always find it not very informative, and it is ambiguous anyway, as $T$ depends on wave speed.  \\
    & \\
    \textcolor{blue}{N/A} & \textcolor{blue}{Dimensionless terms have been included throughout the report, with an additional table, Table 3.3, summarises all wave parameters and relevant dimensionless terms used in the report.}\\ 
    & \\
    \hline
     38 & Referring to the examiner’s comment above about the outdated Figure 4.9, one could say that
    including it was redundant and the candidate might have shown more critical sense.
    The candidate could remove Figure 4.9 from the thesis. If that is not done, at least he should correct
    cnodial to cnoidal in two places in the caption.\\
     & \\
    \textcolor{blue}{37 - 39} & \textcolor{blue}{Figure 4.9 is removed, while additional information is added to make to conclusion with more critical thoughts.}\\    

    \end{longtable}

     %\end{center}
    \end{document}

第 1 页输出

在此处输入图片描述

第 2 页输出

在此处输入图片描述

相关内容