Centering Text within a Multirow Cell in LaTex

前端 未结 4 666
一生所求
一生所求 2021-02-07 03:27

This is probably best explained with an example. I have the following table, where the \"A\" cell spans two rows, and the \"B\" cell spans two columns.

\\begin{t         


        
相关标签:
4条回答
  • 2021-02-07 03:44
    \multirow{2}{*}{\hfil A}
    

    \hfil will automatically calculate the width of the cell and insert a half-width space

    To insert a full cell-width space, which will right-justify a single cell, use \hfill. There are also \vfil and \vfill analogues.

    0 讨论(0)
  • 2021-02-07 03:46

    I think you need to do that with a fake \multicolumn:

    \multicolumn{1}{c}{\multirow{2}{*}{A}} & \multicolumn{2}{c}B} \\
    

    Inspiration from this FAQ.

    0 讨论(0)
  • 2021-02-07 04:01

    I came across a similar problem, but had to use \multirow{specified width}{} instead of \multirow{*}{}. Nesting multirow inside a multicolumn does not work in this case.

    I found \multirow{specified width}{\centering text} to work instead.

    0 讨论(0)
  • 2021-02-07 04:01

    That is could be helpful for someone

    \begin{tabular}{|c c | c|c|c|}
    \hline
    \multicolumn{2}{|c}{\multirow{2}{*}{Modulation}} & \multicolumn{3}{|c|}{M} \\
    \cline{3-5}
    &  & 2  & 4 & 8 \\
    \hline
       \multirow{3}*{\hfil SNR=$\begin{cases}  \\  \\  \end{cases}$}    &  STMA &  xx dB & xx dB & xx dB\\
          &  QTMA    & xx dB & xx dB & xx dB \\
          &  POSTMA & xx dB & xx dB & xx dB\\
    \hline
    \end{tabular}
    
    0 讨论(0)
提交回复
热议问题