0

table

Hello there, here is my table but I can't figure out how to arrange (x,y,z) coordinates in a good looking(i mean they are not in a straight line :) ) and also every box , they start appear center-north, for good looking, I want to center-center :) sorry for bad language. thanks advance.

Here is my code, sorry for not arranging it, I haven't get used to TeX.SE yet :)

\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}
  • Can you please add some code? – egreg Apr 8 '17 at 11:11
  • Please, show code by which you produce your table in form of small, complete document, which we can compile in out computers. Help us to help you! – Zarko Apr 8 '17 at 11:11
  • @Zarko editted. – Alper Erdem Apr 8 '17 at 11:15
  • @egreg i editted the post :) – Alper Erdem Apr 8 '17 at 11:26
  • 1
    @AlperErdem, if sone else not answer before, I will give closet look late evening (GMT). In the first sight, table is huge and I cant believe, that it can be fit in text width. Otherwise, to align coordinates in line, you need to write each coordinate in separate column (with zero \tabcolsep). Also use of S column type from siunitx package would help. – Zarko Apr 8 '17 at 11:26
1

I suggest a more open look to the table and also some tricks for simplifying the input.

However, I believe that the slashed form 10/3 would render better than \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}

enter image description here

  • thank you @egreg it was very useful for me , you are lifesaver :) i have one last thing to figure out, when i use ` \usepackage{fancyhdr} \pagestyle{fancy} \lhead{head1} \rhead{head2} on the page meaningless a word "draft " appears. how can i get rid of it ? – Alper Erdem Apr 8 '17 at 17:22
  • @AlperErdem That is another question, ask a separate one, please! – CarLaTeX Apr 9 '17 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.