使用 xltabular 进行表格格式化

使用 xltabular 进行表格格式化

我在格式化下表时遇到一些问题。

第一个问题:它不是在文本后定位,而是尽管定位了,却还是在新的页面上开始!htbp

第二个问题:表格很大,但无法跳转到第二页。我不确定为什么会发生这种情况。

任何建议都很好!

\textit{Table 2} outlines the structure of this document
\begin{table}[!htbp]
\caption {Document Structure} \label{tab:Document Structure} 
\begin{xltabular}{\textwidth}{|X|} 
    \hline
    \multicolumn{1}{|c|}{Chapter One: Introduction}                                                                                                                                                                                                 \\ \hline
    This chapter will introduce the project and provide the,reader with context of the subject along with the reasons for undertaking the,project and an outline of the project contents.                                                           \\ 
    \hline
    \multicolumn{1}{|c|}{Chapter Two: Literature Review}                                                                                                                                                                                            \\ \hline
    This chapter will review current literature surrounding,the subjects of this project this will explore the current systems and,theoretical systems that form the basis for this project.                                                        \\ \hline
    \multicolumn{1}{|c|}{Chapter Three: Technology Review}                                                                                                                                                                                          \\ \hline
    Throughout this chapter will provide a review of the,technology used in current systems and the technology that will be used for,the proposed system.                                                                                           \\ \hline
    \multicolumn{1}{|c|}{Chapter Four: Analysis of Current Systems}                                                                                                                                                                                 \\ \hline
    In this chapter a comparison of current systems will be,provided to form a platform from which to model the proposed system. This comparison,will be used to model the functionality of the system and methodology used,for testing the system. \\ \hline
    \multicolumn{1}{|c|}{Chapter Five: System Analysis and Requirements}                                                                                                                                                                            \\ \hline
    In this chapter the base functionality for the proposed system,will be discussed and a draft of its implementation will be provided in the,form of system and communication diagrams.                                                           \\ \hline
    \multicolumn{1}{|c|}{Chapter Six: Use Cases}                                                                                                                                                                                                \\ \hline
    Throughout this chapter some examples of use cases will be given. these use cases will for the basis for the modeling of system functionality going forward with the project. For the purpose of this project three use cases will be given. chapter,five.                                                                                                     \\ \hline
    \multicolumn{1}{|c|}{Chapter Seven: System Design}                                                                                                                                                                                                \\ \hline
    Throughout this chapter the system implementation will be,described and discussed based on the findings from chapter four and chapter,five.                                                                                                     \\ \hline
    \multicolumn{1}{|c|}{Chapter Eight: Software}                                                                                                                                                                                                   \\ \hline
    This chapter will discuss the software and how it was,constructed with reference to functionality and system requirements discussed,in previous chapters.                                                                                       \\ \hline
    \multicolumn{1}{|c|}{Chapter Nine: Implementation}                                                                                                                                                                                              \\ \hline
    In this chapter the implementation and integration of the,software into the hardware environment will be discussed with further,reasoning into the choices made on both software modelling and hardware,choices for this project.               \\ \hline
    \multicolumn{1}{|c|}{Chapter Ten: System Testing}                                                                                                                                                                                                                 \\ \hline
    Throughout this chapter a set of test methods will be discussed,,and results of these tests will be displayed. The chosen test method for this,project is user interaction dialogues.                                                           \\ \hline
    \multicolumn{1}{|c|}{Chapter Eleven: Evaluation}                                                                                                                                                                                                                \\ \hline
    This chapter will include a critical evaluation of the,system as well as any changes and limitations that were experienced along,with how these limitations were dealt with and how the project was adapted to,these changes.                   \\ \hline
    \multicolumn{1}{|c|}{Chapter Twelve: Conclusion}                                                                                                                                                                                                                \\ \hline
    In this chapter a conclusion will be drawn, and a review,of the objectives will be carried out to determine if the project achieved the, aims that were set out for it.                                                                          \\ \hline
\end{xltabular}
\end{table}

答案1

通过查看您那里的示例文本,在我看来,我们似乎处于您的报告/论文的文档结构部分。

考虑到这个问题,我建议longtablebooktabs为了您想要完成的事情。

Longtable 允许您跨越多个页面,而 booktabs 使您可以很好地控制规则。

\documentclass[11pt]{report}
\usepackage{longtable, booktabs}

\begin{document}
\textit{Table 2} outlines the structure of this document
    \begin{longtable}{p{\textwidth}l}
        \textbf{Chapter One: Introduction} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        This chapter will introduce the project and provide the,reader with context of the subject along with the reasons for undertaking the, project and an outline of the project contents. &\\ \addlinespace[10pt]
        \textbf{Chapter Two: Literature Review} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        This chapter will review current literature surrounding,the subjects of this project this will explore the current systems and,theoretical systems that form the basis for this project.  &\\ \addlinespace[10pt]
        \textbf{Chapter Three: Technology Review} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        Throughout this chapter will provide a review of the,technology used in current systems and the technology that will be used for,the proposed system. &\\ \addlinespace[10pt]
        \textbf{Chapter Four: Analysis of Current Systems} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        In this chapter a comparison of current systems will be,provided to form a platform from which to model the proposed system. This comparison,will be used to model the functionality of the system and methodology used,for testing the system. &\\ \addlinespace[10pt]
        \textbf{Chapter Five: System Analysis and Requirements} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        In this chapter the base functionality for the proposed system,will be discussed and a draft of its implementation will be provided in the,form of system and communication diagrams. &\\ \addlinespace[10pt]
        \textbf{Chapter Six: Use Cases} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
  Throughout this chapter some examples of use cases will be given.\ these use cases will for the basis for the modeling of system functionality going forward with the project. For the purpose of this project three use cases will be given.\ chapter,five. & \\ \addlinespace[10pt]
        \textbf{Chapter Seven: System Design} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        Throughout this chapter the system implementation will be,described and discussed based on the findings from chapter four and chapter,five. &\\ \addlinespace[10pt]
        \textbf{Chapter Eight: Software} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        This chapter will discuss the software and how it was,constructed with reference to functionality and system requirements discussed,in previous chapters.  &\\ \addlinespace[10pt]
        \textbf{Chapter Nine: Implementation} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        In this chapter the implementation and integration of the,software into the hardware environment will be discussed with further,reasoning into the choices made on both software modelling and hardware,choices for this project.  &\\ \addlinespace[10pt]
        \textbf{Chapter Ten: System Testing} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
        Throughout this chapter a set of test methods will be discussed,,and results of these tests will be displayed. The chosen test method for this,project is user interaction dialogues.  &\\ \addlinespace[10pt]
        \textbf{Chapter Eleven: Evaluation} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
  This chapter will include a critical evaluation of the,system as well as any changes and limitations that were experienced along,with how these limitations were dealt with and how the project was adapted to,these changes.  &\\ \addlinespace[10pt]
        \textbf{Chapter Twelve: Conclusion} &\\ \cmidrule[\heavyrulewidth](l{-5pt}r{20pt}){1-2}
  In this chapter a conclusion will be drawn, and a review,of the objectives will be carried out to determine if the project achieved the, aims that were set out for it.   &\\ \bottomrule
        \caption{Document Structure}\label{tab:Document Structure}
    \end{longtable}
\end{document}

这将给你以下结果: 在此处输入图片描述

相关内容