表格中的垂直对齐文本

表格中的垂直对齐文本

我如何按照附件修复第 1 列(公司级别和业务级别)的对齐方式?如何垂直对齐文本:顶部、中间、底部?

输出 在此处输入图片描述

    \documentclass[preview]{standalone}
    
     \usepackage{booktabs}
     \usepackage{graphicx}
     \usepackage{multirow}
     \usepackage{tabularx}
    
    \begin{document}
    
    \begin{table}
        \centering
        \resizebox{\textwidth}{!}{%
            \begin{tabular}{m{0.2\textwidth}p{0.3\textwidth}p{0.5\textwidth}}
                \toprule
                \textbf{Strategy type} & \textbf{\begin{tabular}[c]{@{}l@{}}Airlines strategic \\ options\end{tabular}} & \textbf{Practical examples} \\ \midrule
                \multirow{5}{*}{\begin{tabular}[t]{@{}l@{}}Corporate \\ Level\end{tabular}} & Diversification & Passenger aircraft, cargo, logistics management, private charters. \\ \cmidrule(l){2-3} 
                & Horizontal integration (including mergers and acquisitions) & Expanding range (short haul, long haul); acquiring other airlines. \\ \cmidrule(l){2-3} 
                & Vertical integration (forward and backward) & Ticket booking (IT systems); ground handling; catering; car/hotel services. \\ \cmidrule(l){2-3} 
                & Divestment/spin-offs & Lufthansa innovation hub spin-off start-up RYDES \\\cmidrule(l){2-3} 
                & Alliances & Alliances such as Oneworld, Star Alliance, SkyTeam; code-sharing, frequent flyer partnerships. \\ \cmidrule(l){2-3} 
                \multirow{4}{*}{\begin{tabular}[t]{@{}l@{}}Business \\ Level\end{tabular}} & Differentiation & Full-service   network airlines \\ \midrule
                & Low-cost & No frills point-to-point   airlines \\ \cmidrule(l){2-3} 
                & Niche & Luxury, private charters, wetlease, and regional airlines. \\ \cmidrule(l){2-3} 
                & Hybrid & Integration of point-to-point network with service differentiation, integration of global networks with regionally lower service levels. \\ \bottomrule
            \end{tabular}}
    \end{table}
    
    \end{document}

答案1

您可以通过摆脱\multirow包装器来实现格式化目标。我还建议您切换到环境tabularx,这样您就可以摆脱\resizebox大锤。您可能还想考虑\cmidrule(l){2-3}\addlinespace-- 空格替换指令,它可以作为与实心黑线一样好的视觉分隔符。

顺便说一句,你把“Business Level”这个字符串放在了错误的行中。它应该放在“Low-cost”旁边,而不是“Differentiation”旁边。

在此处输入图片描述

\documentclass{article}  
\usepackage{booktabs,tabularx,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}

\begin{table}
\begin{tabularx}{\textwidth}{@{} l P{0.28\textwidth} L @{}}
\toprule
  \bfseries Strategy type 
& \bfseries Airlines strategic options
& \bfseries Practical examples \\ 
\midrule
  Corporate Level 
& Diversification 
& Passenger aircraft, cargo, logistics management, private charters. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Horizontal integration (including mergers and acquisitions) 
& Expanding range (short haul, long haul); acquiring other airlines. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Vertical integration (forward and backward) 
& Ticket booking (IT systems); ground handling; catering; car/hotel 
  services. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Divestment\slash spin-offs 
& Lufthansa innovation hub spin-off start-up RYDES. \\
\addlinespace % \cmidrule(l){2-3} 
& Alliances 
& Alliances such as Oneworld, Star Alliance, SkyTeam; code-sharing, 
  frequent flyer partnerships. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Differentiation 
& Full-service network airlines. \\ 
\midrule
  Business Level 
& Low-cost 
& No frills point-to-point airlines. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Niche 
& Luxury, private charters, wetlease, and regional airlines. \\ 
\addlinespace % \cmidrule(l){2-3} 
& Hybrid 
& Integration of point-to-point network with service differentiation, 
  integration of global networks with regionally lower service levels. \\ 
\bottomrule
\end{tabularx}
\end{table}

\end{document}

答案2

使用该tabularray包的替代方法:

\documentclass{article}
\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
    \begin{table}
\begin{tblr}{colspec = {@{} l X[1.1, cmd=\RaggedRight] X[2, cmd=\RaggedRight] @{}},
             row{1}  = {font=\bfseries, m}
             }
    \toprule
Strategy type
    & Airlines strategic options
        & Practical examples    \\
    \midrule
Corporate Level
    & Diversification
        & Passenger aircraft, cargo, logistics management, private charters. \\
    & Horizontal integration (including mergers and acquisitions)
        & Expanding range (short haul, long haul); acquiring other airlines. \\
    & Vertical integration (forward and backward)
        & Ticket booking (IT systems); ground handling; catering; car/hotel
  services. \\

    & Divestment\slash spin-offs
        & Lufthansa innovation hub spin-off start-up RYDES. \\
    & Alliances
        & Alliances such as Oneworld, Star Alliance, SkyTeam; code-sharing,
  frequent flyer partnerships. \\
    & Differentiation
        & Full-service network airlines. \\
    \midrule
Business Level
    & Low-cost
        & No frills point-to-point airlines. \\
    & Niche
        & Luxury, private charters, wetlease, and regional airlines. \\
    & Hybrid
        & Integration of point-to-point network with service differentiation,
  integration of global networks with regionally lower service levels. \\
    \bottomrule
\end{tblr}
    \end{table}
\end{document}

在此处输入图片描述

相关内容