【问题标题】:How to move table to the left or not exceed the right margin?如何将表格向左移动或不超过右边距?
【发布时间】:2021-08-02 03:59:30
【问题描述】:

我在课堂上使用 Overleaf 做笔记,但在尝试创建表格列时遇到了麻烦。我的代码如下:

\begin{center}
    \begin{tabular}{|c|c|}
    \hline
    Crystalline Solids & Non-Crsytalline Solids \\
    \hline 
    i. Atoms and molecules are periodic in space & i. Atoms and molecules are not periodic in space \\
    \hline 
    ii. Some crystalline solids are anisotopic \\ 
    i.e the magnitudes of the physical properties like \\
    refractive index, electrical conductivity are \\
    different along difference directions \\  & ii. Physical properties are isotropic \\
    \hline 
    iii. Have sharp melting points & iii. Do not have sharp boiling points - a range is present \\
    \hline 
    iv. Breaks are observed in the cooling curve & iv. No breaks in cooling curve \\
    \hline 
    v. Breaks along sharp edges i.e breaks \\ 
    along specific "crystallographic planes" & v. Broken surfaces are irregular because there are no crystal planes \\
    \hline 
    \end{tabular}
\end{center}

问题是现在我的表看起来像这样。 https://imgur.com/ZrWFNSS 我曾尝试使用\begin{table} 环境和\begin{figure} 环境,但即使使用了[h][ht] 之类的限定符,表格在文本中的位置也会发生变化,并且对齐仍然关闭。如何更正它以使其适合页面?

【问题讨论】:

    标签: latex tex overleaf


    【解决方案1】:

    clr 列不包装其内容。您必须为您的tabular 使用固定宽度的p{<len>} 列,或者考虑使用tabularx

    这是一个带有paragraph-style 列规范的选项:

    \documentclass{article}
    
    \usepackage{booktabs}
    
    \begin{document}
    
    \begin{center}
      \begin{tabular}{ l p{.45\linewidth} p{.45\linewidth} }
        \toprule
             & \multicolumn{1}{c}{Crystalline Solids} & 
              \multicolumn{1}{c}{Non-Crystalline Solids} \\
        \midrule
        i.   & Atoms and molecules are periodic in space & 
          Atoms and molecules are not periodic in space \\
        ii.  & Some crystalline solids are anisotopic \textit{i.e.}~the magnitudes of the physical properties 
          like refractive index, electrical conductivity are different along difference directions & 
            Physical properties are isotropic \\
        iii. & Have sharp melting points & 
          Do not have sharp boiling points --- a range is present \\
        iv. & Breaks are observed in the cooling curve & 
          No breaks in cooling curve \\
        v. & Breaks along sharp edges i.e breaks along specific ``crystallographic planes'' & 
          Broken surfaces are irregular because there are no crystal planes \\
        \bottomrule 
      \end{tabular}
    \end{center}
    
    \end{document}
    

    这是使用tabularx 的类似选项:

    \documentclass{article}
    
    \usepackage{tabularx,booktabs}
    
    \begin{document}
    
    \noindent
    \begin{tabularx}{\linewidth}{ l X X }
      \toprule
           & \multicolumn{1}{c}{Crystalline Solids} & 
            \multicolumn{1}{c}{Non-Crystalline Solids} \\
      \midrule
      i.   & Atoms and molecules are periodic in space & 
        Atoms and molecules are not periodic in space \\
      ii.  & Some crystalline solids are anisotopic \textit{i.e.}~the magnitudes of the physical properties 
        like refractive index, electrical conductivity are different along difference directions & 
          Physical properties are isotropic \\
      iii. & Have sharp melting points & 
        Do not have sharp boiling points~--- a range is present \\
      iv. & Breaks are observed in the cooling curve & 
        No breaks in cooling curve \\
      v. & Breaks along sharp edges i.e breaks along specific ``crystallographic planes'' & 
        Broken surfaces are irregular because there are no crystal planes \\
      \bottomrule 
    \end{tabularx}
    
    \end{document}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-14
      • 2014-03-18
      • 2016-09-23
      • 2017-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-19
      相关资源
      最近更新 更多