多行文本从下至上(或反之亦然)

多行文本从下至上(或反之亦然)

是否可以格式化表格,使一列中的文本分布在多行中,且文本从下到上垂直显示,或从上到下垂直显示?在这种情况下,给定应该是该列并且文本大小应该适合几行跨度。

\begin{center}
\begin{tabular}{r|c|r|r|l|l|l|r|l}
\multicolumn{1}{c|}{$i$} & class & \multicolumn{1}{c|}{$x_i$} & \multicolumn{1}{c|}{$f_i$} & \multicolumn{1}{c|}{$f_{r_i} = \frac{f_i}{n+1}$} & \multicolumn{1}{c|}{$\Phi_i = \sum\limits_{i=1} f_{r_i}$} & \multicolumn{1}{c|}{$f_{tr_i}$} & \multicolumn{1}{c|}{$f_{t_i} = n \cdot f_{tr_i}$} & \multicolumn{1}{c}{$F_i = \sum\limits_{i=1} f_{tr_i}$} \\\hline
1                       & 14–18 & 16                        & 28                        &                              &                                   & given                          & 27,7                         &                                    \\
2                       & 18–22 & 20                        & 18                        &                              &                                   & given                          & 18,3                         &                                    \\
3                       & 22–26 & 24                        & 11                        &                              &                                   & given                          & 11,05                        &                                    \\
4                       & 26–30 & 28                        & 9                         &                              &                                   & given                          & 6,5                          &                                    \\
5                       & 30–34 & 32                        & 2                         &                              &                                   & given                          & 3,8                          &                                    \\
6                       & 34–38 & 36                        & 2                         &                              &                                   & given                          & 2,2                          &                                    \\
7                       & 38–42 & 40                        & 0                         &                              &                                   & given                          & 1,9                          &                                    \\
8                       & 42–46 & 44                        & 1                         &                              &                                   & given                          & 0,7                          &                                    \\
9                       & 46–50 & 48                        & 1                         &                              &                                   & given                          & 0,43                         &                                    \\
10                      & 50–52 & 52                        & 1                         &                              &                                   & given                          & 0,24                         &                                   
\end{tabular}
\end{center}

或者这里,如何跨越文本给定,再次,最好使用大一点的字体,并分成几列?

\begin{center}
\begin{tabular}{c|cccccc}
    T                                    & 2    & 5    & 10   & 25   & 50   & 100  \\ \hline
    $x_T$                                & given & given & given & given & given & given \\
    $x'_T$                               &      &      &      &      &      &      \\
    $x''_T$                              &      &      &      &      &      &      \\
    $\displaystyle\frac{B}{\sqrt{n}}$ & given & given & given & given & given & given
\end{tabular}
\end{center}

太感谢了!

答案1

也许是这样的?

\documentclass{article}
\usepackage{multirow, rotating, graphicx}
\usepackage{siunitx, makecell, bigstrut}

\begin{document}

\begin{center}
\sisetup{table-format=2.2, output-decimal-marker={,}}
\setcellgapes{2pt}\makegapedcells
\begin{tabular}{r|c|r|r|l|c|l|S|l}
\multicolumn{1}{c|}{$i$} & class & \multicolumn{1}{c|}{$x_i$} & \multicolumn{1}{c|}{$f_i$} & \multicolumn{1}{c|}{$f_{r_i} = \frac{f_i}{n+1}$} & \multicolumn{1}{c|}{$\Phi_i = \sum\limits_{i=1} f_{r_i}$} & \multicolumn{1}{c|}{$f_{tr_i}$} & \bigstrut{$f_{t_i} = n \cdot f_{tr_i}$} & \multicolumn{1}{c}{$F_i = \sum\limits_{i=1} f_{tr_i}$} \\\hline
\bigstrut[t] 1 & 14–18 & 16 & 28 & & & \multirow{11}{*}{\Large \hspace{0.2ex}\rotatebox{90}{given}} & 27,7 & \\%
2 & 18–22 & 20 & 18 & & & & 18,3 & \\
3 & 22–26 & 24 & 11 & & & & 11,05 & \\
4 & 26–30 & 28 & 9 & & & & 6,5 & \\
5 & 30–34 & 32 & 2 & & & & 3,8 & \\
6 & 34–38 & 36 & 2 & & & & 2,2 & \\
7 & 38–42 & 40 & 0 & & & & 1,9 & \\
8 & 42–46 & 44 & 1 & & & & 0,7 & \\
9 & 46–50 & 48 & 1 & & & & 0,43 & \\
10 & 50–52 & 52 & 1 & & & & 0,24 &
\end{tabular}
\end{center}

\end{document} 

在此处输入图片描述

答案2

伯纳德,非常感谢!

以下是我最终做的事情:

\begin{center}
\sisetup{table-format=2.2, output-decimal-marker={,}}
\setcellgapes{2pt}\makegapedcells
\begin{tabular}{rcrrlclSl}
\multicolumn{1}{c}{$i$} & classes & \multicolumn{1}{c}{$x_i$} & \multicolumn{1}{c}{$f_i$} & \multicolumn{1}{c}{${\scriptstyle f_{r_i} = \frac{f_i}{n+1}}$} & \multicolumn{1}{c}{${\scriptstyle\Phi_i = \sum\limits_{i=1} f_{r_i}}$} & \multicolumn{1}{c}{$f_{tr_i}$} & \bigstrut{${\scriptstyle f_{t_i} = n \cdot f_{tr_i}}$} & \multicolumn{1}{c}{${\scriptstyle F_i = \sum\limits_{i=1} f_{tr_i}}$} \\\midrule
\bigstrut[t] 1 & 14–18 & 16 & 28 & & \multirow{11}{*}{  \hspace{0.2ex}\rotatebox{90}{not wanted}} & \multirow{11}{*}{ \hspace{0.2ex}\rotatebox{90}{Scientific WorkPlace}} & 27,7 & \multirow{11}{*}{\hspace{0.2ex}\rotatebox{90}{not wanted}}\\%
2 & 18–22 & 20 & 18 & & & & 18,3 & \\
3 & 22–26 & 24 & 11 & & & & 11,05 & \\
4 & 26–30 & 28 & 9 & & & & 6,5 & \\
5 & 30–34 & 32 & 2 & & & & 3,8 & \\
6 & 34–38 & 36 & 2 & & & & 2,2 & \\
7 & 38–42 & 40 & 0 & & & & 1,9 & \\
8 & 42–46 & 44 & 1 & & & & 0,7 & \\
9 & 46–50 & 48 & 1 & & & & 0,43 & \\
10 & 50–52 & 52 & 1 & & & & 0,24 &

\end{表格} \end{中心}

不过,我似乎无法将文本置于最后一列的中心。

你知道我做错什么了吗?

相关内容