排列行和列

排列行和列

桌子

你好,这是我的表格,但我无法弄清楚如何排列(x,y,z)坐标以便好看(我的意思是它们不在一条直线上:))并且每个框,它们开始出现在中心北,为了好看,我想要居中:)抱歉我的语言不好。提前谢谢。

这是我的代码,抱歉没有整理好,我还没有习惯 TeX.SE :)

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
  \hline
  Step(k) & I.strategy & II.strategy & $\,$ Return $\,$ & Total Return &$\quad$ $g_{i}^r$ $\quad$ &$\quad$ $g_{k}^c$ $\quad$ & $\,$ $U_k$ $\,$ & $\,$ $V_k$  $\,$ & $\displaystyle \frac{minU_k}{k}$ & $ \displaystyle \frac{maxV_k}{k}$ \\[2ex] \hline
   1 & $I_1$ & $II_1$ & 9 & 9 & (9,2,-1) & (9,-9,6) & (9,2,{\color{blue}-1})     & ({\color{red}9},-9,6)     & -1              & 9               \\[1.5ex] \hline
   2 & $I_1$ & $II_3$ &-1 & 8 & (9,2,-1) & (-1,0,2) & (18,4,{\color{blue}-2})    & ({\color{red}8},-9,8)     & -1              & 4               \\[1.5ex] \hline 
   3 & $I_1$ & $II_3$ &-1 & 7 & (9,2,-1) & (-1,0,2) & (27,6,{\color{blue}-3})    & (7,-9,{\color{red}10})    & -1              & $\frac{10}{3}$     \\[1.5ex] \hline
   4 & $I_3$ & $II_3$ & 2 & 9 & (6,-6,2) & (-1,0,2) & (33,0,{\color{blue}-1})    & (6,-9,{\color{red}12})    & $-\frac{1}{4}$  & $3$              \\[1.5ex] \hline
   5 & $I_3$ & $II_3$ & 2 &11 & (6,-6,2) & (-1,0,2) & (39,{\color{blue}-6},1)    & (5,-9,{\color{red}14})    & $-\frac{6}{5}$  & $\frac{14}{5}$     \\[1.5ex] \hline 
   6 & $I_3$ & $II_2$ &-6 & 5 & (6,-6,2) & (2,9,-6) & (45,{\color{blue}-12},3)   & (7,0,{\color{red}8})      & $-2$            & $\frac{4}{3}$     \\[1.5ex] \hline
   7 & $I_3$ & $II_2$ &-6 &-1 & (6,-6,2) & (2,9,-6) & (51,{\color{blue}-18},5)   & ({\color{red}9},9,2)      & $-\frac{18}{7}$ & $\frac{9}{7}$     \\[1.5ex] \hline
   8 & $I_1$ & $II_2$ & 2 & 1 & (9,2,-1) & (2,9,-6) & (60,{\color{blue}-16},4)   & (11,{\color{red}18},-4)   & $-2$            & $\frac{9}{4}$     \\[1.5ex] \hline 
   9 & $I_2$ & $II_2$ & 9 &10 & (-9,9,0) & (2,9,-6) & (51,{\color{blue}-7},4)    & (13,{\color{red}17},-10)  & $-\frac{7}{9}$  & $\frac{17}{9}$     \\[1.5ex] \hline
  10 & $I_2$ & $II_2$ & 9 &19 & (-9,9,0) & (2,9,-6) & (42,{\color{blue}2},4)     & (15,{\color{red}26},-16)  & $\frac{1}{5}$   & $\frac{13}{5}$     \\[1.5ex] \hline 
  11 & $I_2$ & $II_2$ & 9 &28 & (-9,9,0) & (2,9,-6) & (33,11,{\color{blue}4})    & (17,{\color{red}35},-22)  & $\frac{4}{11}$  & $\frac{35}{11}$     \\[1.5ex] \hline
  12 & $I_2$ & $II_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (24,20,{\color{blue}4})    & (16,{\color{red}35},-20)  & $\frac{1}{3}$   & $\frac{35}{12}$     \\[1.5ex] \hline 
  13 & $I_2$ & $II_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (15,29,{\color{blue}4})    & (15,{\color{red}35},-18)  & $\frac{4}{13}$  & $\frac{35}{13}$     \\[1.5ex] \hline
  14 & $I_2$ & $II_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (6,38,{\color{blue}4})     & (14,{\color{red}35},-16)  & $\frac{4}{14}$  & $\frac{35}{14}$     \\[1.5ex] \hline
  15 & $I_2$ & $II_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & ({\color{blue}-3},47,4)    & (13,{\color{red}35},-14)  & $-\frac{3}{5}$  & $\frac{7}{3}$     \\[1.5ex] \hline
\end{tabular}

答案1

我建议以更开放的眼光看待表格,并采用一些简化输入的技巧。

不过,我相信斜线形式的10/3渲染效果会比 更好\frac{10}{3}

\documentclass{article}
\usepackage[landscape,a4paper]{geometry}
\usepackage{array,booktabs}
\usepackage{amsmath}
\usepackage{xcolor}

\newcommand{\bn}[1]{% blue number
  \textcolor{blue}{#1}%
}
\newcommand{\rn}[1]{% red number
  \textcolor{red}{#1}%
}

\begin{document}

\begin{table}
\centering

\renewcommand{\arraystretch}{1.2}
\addtolength{\tabcolsep}{-.2pt}

\begin{tabular}{
  *{3}{c}
  *{8}{>{$}c<{$}}
}
\toprule
Step($k$) &
  Strategy I &
  Strategy II &
  \multicolumn{1}{c}{Return} &
  \multicolumn{1}{c}{Total Return} &
  g_{i}^r &
  g_{k}^c &
  U_k &
  V_k &
  \dfrac{\min U_k}{k} &
  \dfrac{\max V_k}{k} \\
\midrule
   1 & I$_1$ & II$_1$ & 9 & 9 & (9,2,-1) & (9,-9,6) & (9,2,\bn{-1})     & (\rn{9},-9,6)     & -1              & 9               \\
   2 & I$_1$ & II$_3$ &-1 & 8 & (9,2,-1) & (-1,0,2) & (18,4,\bn{-2})    & (\rn{8},-9,8)     & -1              & 4               \\ 
   3 & I$_1$ & II$_3$ &-1 & 7 & (9,2,-1) & (-1,0,2) & (27,6,\bn{-3})    & (7,-9,\rn{10})    & -1              & \frac{10}{3}     \\
   4 & I$_3$ & II$_3$ & 2 & 9 & (6,-6,2) & (-1,0,2) & (33,0,\bn{-1})    & (6,-9,\rn{12})    & -\frac{1}{4}  & 3              \\
   5 & I$_3$ & II$_3$ & 2 &11 & (6,-6,2) & (-1,0,2) & (39,\bn{-6},1)    & (5,-9,\rn{14})    & -\frac{6}{5}  & \frac{14}{5}     \\ 
   6 & I$_3$ & II$_2$ &-6 & 5 & (6,-6,2) & (2,9,-6) & (45,\bn{-12},3)   & (7,0,\rn{8})      & -2            & \frac{4}{3}     \\
   7 & I$_3$ & II$_2$ &-6 &-1 & (6,-6,2) & (2,9,-6) & (51,\bn{-18},5)   & (\rn{9},9,2)      & -\frac{18}{7} & \frac{9}{7}     \\
   8 & I$_1$ & II$_2$ & 2 & 1 & (9,2,-1) & (2,9,-6) & (60,\bn{-16},4)   & (11,\rn{18},-4)   & -2            & \frac{9}{4}     \\ 
   9 & I$_2$ & II$_2$ & 9 &10 & (-9,9,0) & (2,9,-6) & (51,\bn{-7},4)    & (13,\rn{17},-10)  & -\frac{7}{9}  & \frac{17}{9}     \\
  10 & I$_2$ & II$_2$ & 9 &19 & (-9,9,0) & (2,9,-6) & (42,\bn{2},4)     & (15,\rn{26},-16)  & \frac{1}{5}   & \frac{13}{5}     \\ 
  11 & I$_2$ & II$_2$ & 9 &28 & (-9,9,0) & (2,9,-6) & (33,11,\bn{4})    & (17,\rn{35},-22)  & \frac{4}{11}  & \frac{35}{11}     \\
  12 & I$_2$ & II$_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (24,20,\bn{4})    & (16,\rn{35},-20)  & \frac{1}{3}   & \frac{35}{12}     \\
  13 & I$_2$ & II$_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (15,29,\bn{4})    & (15,\rn{35},-18)  & \frac{4}{13}  & \frac{35}{13}     \\
  14 & I$_2$ & II$_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (6,38,\bn{4})     & (14,\rn{35},-16)  & \frac{4}{14}  & \frac{35}{14}     \\
  15 & I$_2$ & II$_3$ & 0 &28 & (-9,9,0) & (-1,0,2) & (\bn{-3},47,4)    & (13,\rn{35},-14)  & -\frac{3}{5}  & \frac{7}{3}     \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

在此处输入图片描述

相关内容