如何在指定大小的表格列中居中文本

如何在指定大小的表格列中居中文本
\begin{table}
    
    \caption{SAW parameters of selected substrate materials\cite{campbell1991surface}}
    \label{materialtable}
    \begin{tabular}{lm{1.5cm}m{1cm\centering}m{2cm}cm{2.5cm}m{3cm}}
    \hline
        \textbf{Material}&\textbf{Crystal Cut}&\textbf{SAW Axis}&\textbf{SAW Velocity (m/s)}& \textbf{$K^2(\%)$}&  \textbf{Temperature coefficient of Delay (ppm/\textcelsius)}&\textbf{Application}\\
       \hline
       Quartz& ST&X&3158& 0.11&0&Oscillators,Filters\\
      $LiNbO_3$&Y&Z&3488 &4.5& +94&Wide-band filters\\
       $LiNbO_3$&128\textdegree&X&3992&5.3&+75&Wide-band filters\\
        \vspace{.3cm}
       $Bi_12GeO_20$&110&001& 1681&1.4&+120&Long delay times\\
  
       $LiTaO_3$&Y&Z&3230&0.72&+35&Oscillators\\
       GaAs&\textless001\textgreater&(110)&\textless2841&\textless0.06&-49&Semiconductor IC\\
       \hline       
    \end{tabular}
\end{table}

答案1

我会按照以下方式编写您的表格:

  • 使用tabularray表格包,其列说明符具有简单的语法来声明在单元格中居中的文本(参见下面的 MWE)
  • 使用mhchem 包(如评论中所建议)进行化学表达式,
  • 对于水平规则,使用booktabs包中定义的规则(作为tabularray库加载)
  • 对于单位和数量使用siunitx

MWE(最小工作示例):

\documentclass{article}
\usepackage{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage[T1]{fontenc}

\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\sisetup{input-comparators,
         retain-explicit-plus}
\usepackage[version=4]{mhchem}


\begin{document}
\begin{table}[htb]
    \caption{SAW parameters of selected substrate materials \cite{campbell1991surface}}
    \label{materialtable}
    \centering
\begin{tblr}{colsep=4pt,
             colspec = {@{} l *{2}{X[c]}
                        X[2, c, si={table-format={<\,}4.0}] 
                        X[   c, si={table-format={<\,}1.3}, mode=math]
                        X[2.2, c, si={table-format=-3.0}]
                        l
                        @{}},
              row{1}  = {guard, m, font=\small\bfseries}
              }
    \toprule
Material    
    & Crystal Cut   
        & SAW Axis  
            & SAW Velocity (\unit{meter\per\second})    
                &  K^2\ (\%) 
                    & Temperature coefficient of Delay (\unit{ppm\per\degreeCelsius})
                        & Application           \\
    \midrule
Quartz          & ST                    & X     & 3158  & 0.11  &    0  & Oscillators, Filters  \\
\ce{LiNbO3}     & Y                     & Z     & 3488  & 4.5   &  +94  & Wide-band filters     \\
\ce{LiNbO3}     & \qty{128}{\degree}    & X     & 3992  & 5.3   &  +75  & Wide-band filters     \\
\ce{Bi12GeO20}  & 110                   & 001   & 1681  & 1.4   & +120  & Long delay times      \\
\addlinespace
\ce{LiTaO3}     & Y                     & Z     & 3230  & 0.72  &  +35  &   Oscillators         \\
\ce{GaAs}       & <001>                 & (110) & <2841 & <0.06 &  -49  & Semiconductor IC      \\
    \bottomrule
\end{tblr}
    \end{table}
\end{document}

在此处输入图片描述

(红线表示页面布局)

相关内容