The sidewaystable
environment doesn't limit you to one table per page. As long as the tabular
(or tabular*
, etc.) environments fit in a single (rotated) page, you can have more than one of these environments on a page typeset in a sidewaystable
construct.
For instance, the following code places two simple tabular*
environments one below the other (or, if you will, side by side...) on one page. Note that they can be given captions and be cross-referenced like any other tabular construct.
\documentclass{article}
\usepackage{rotating,booktabs}
\begin{document}
Cross-references to tables \ref{tab:1} and \ref{tab:2}.
\begin{sidewaystable}
\caption{First table} \label{tab:1}
\smallskip
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} *{9}{c}}
\toprule
a & b & c & d & e & f & g & h & i & j \\
\bottomrule
\end{tabular*}
\bigskip\bigskip % provide some separation between the two tables
\caption{Second table} \label{tab:2}
\smallskip
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} *{9}{c}}
\toprule
a & b & c & d & e & f & g & h & i & j \\
\bottomrule
\end{tabular*}
\end{sidewaystable}
\end{document}
Given that each tabular
environment has 31 [!] columns, I see no way how they might be made to fit side-by-side on a page, unless you're willing to go with a microscopic font size and thereby assure that they'll be unreadable unless the reader happens to have a magnifying glass.
Even if one sets the font size to \tiny
, for a 50% linear reduction from \normalsize
, and sets the parameter \tabcolsep
to 1.75pt
(default value: 6pt), one can barely make one tabular
fit, assuming A4 for the paper size and margins of 2.5cm. Thus, the tables must be placed one above the other.
By the way, it's better to set the relative font size to \tiny
than to employ the \resizebox{\columnwidth}{!}{...}
method to make the table fit inside the textblock. By choosing \tiny
, one gets glyphs that are optimized for readability at 5pt
; in contrast, the \resizebox
approach will give you linearly-reduced normal-shaped glyphs, which aren't meant to be read at 5pt
sizes.
Oh, and since it would be appear to be important to align the numbers on their respective decimal markers, do use a package such as dcolumn
to achieve this type of alignment, instead of the c
alignment.
\documentclass{article}
\usepackage{rotating,booktabs,caption}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page size parameters
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{r}{#1}} % handy shortcut macro
\begin{document}
\begin{sidewaystable}
\tiny
\setlength\tabcolsep{1.75pt} % default value: 6pt
\centering
\caption[test3]{test3}
\begin{tabular}{@{} l *{30}{d{3.2}} @{}}
\toprule
YTM & \mc{1Y} & \mc{2Y} & \mc{3Y} & \mc{4Y} & \mc{5Y} & \mc{6Y} & \mc{7Y} & \mc{8Y} & \mc{9Y} & \mc{10Y} & \mc{11Y} & \mc{12Y} & \mc{13Y} & \mc{14Y} & \mc{15Y} & \mc{16Y} & \mc{17Y} & \mc{18Y} & \mc{18Y} & \mc{20Y} & \mc{21Y} & \mc{22Y} & \mc{23Y} & \mc{24Y} & \mc{25Y} & \mc{26Y} & \mc{27Y} & \mc{28Y} & \mc{29Y} & \mc{30Y} \\
\midrule
0\% & 110.00 & 120.00 & 130.00 & 140.00 & 150.00 & 160.00 & 170.00 & 180.00 & 190.00 & 200.00 & 210.00 & 220.00 & 230.00 & 240.00 & 250.00 & 260.00 & 270.00 & 280.00 & 290.00 & 300.00 & 310.00 & 320.00 & 330.00 & 340.00 & 350.00 & 360.00 & 370.00 & 380.00 & 390.00 & 400.00 \\
1\% & 108.91 & 117.73 & 126.47 & 135.12 & 143.68 & 152.16 & 160.55 & 168.87 & 177.09 & 185.24 & 193.31 & 201.30 & 209.20 & 217.03 & 224.79 & 232.46 & 240.06 & 247.58 & 255.03 & 262.41 & 269.71 & 276.94 & 284.10 & 291.19 & 298.21 & 305.16 & 312.04 & 318.85 & 325.59 & 332.27 \\
2\% & 107.84 & 115.53 & 123.07 & 130.46 & 137.71 & 144.81 & 151.78 & 158.60 & 165.30 & 171.86 & 178.29 & 184.60 & 190.79 & 196.85 & 202.79 & 208.62 & 214.33 & 219.94 & 225.43 & 230.81 & 236.09 & 241.26 & 246.34 & 251.31 & 256.19 & 260.97 & 265.66 & 270.25 & 274.76 & 279.17 \\
3\% & 106.80 & 113.39 & 119.80 & 126.02 & 132.06 & 137.92 & 143.61 & 149.14 & 154.50 & 159.71 & 164.77 & 169.68 & 174.44 & 179.07 & 183.57 & 187.93 & 192.16 & 196.27 & 200.27 & 204.14 & 207.91 & 211.56 & 215.11 & 218.55 & 221.89 & 225.14 & 228.29 & 231.35 & 234.32 & 237.20 \\
4\% & 105.77 & 111.32 & 116.65 & 121.78 & 126.71 & 131.45 & 136.01 & 140.40 & 144.61 & 148.67 & 152.56 & 156.31 & 159.91 & 163.38 & 166.71 & 169.91 & 172.99 & 175.96 & 178.80 & 181.54 & 184.17 & 186.71 & 189.14 & 191.48 & 193.73 & 195.90 & 197.98 & 199.98 & 201.90 & 203.75 \\
5\% & 104.76 & 109.30 & 113.62 & 117.73 & 121.65 & 125.38 & 128.93 & 132.32 & 135.54 & 138.61 & 141.53 & 144.32 & 146.97 & 149.49 & 151.90 & 154.19 & 156.37 & 158.45 & 160.43 & 162.31 & 164.11 & 165.82 & 167.44 & 168.99 & 170.47 & 171.88 & 173.22 & 174.49 & 175.71 & 176.86 \\
6\% & 103.77 & 107.33 & 110.69 & 113.86 & 116.85 & 119.67 & 122.33 & 124.84 & 127.21 & 129.44 & 131.55 & 133.54 & 135.41 & 137.18 & 138.85 & 140.42 & 141.91 & 143.31 & 144.63 & 145.88 & 147.06 & 148.17 & 149.21 & 150.20 & 151.13 & 152.01 & 152.84 & 153.62 & 154.36 & 155.06 \\
7\% & 102.80 & 105.42 & 107.87 & 110.16 & 112.30 & 114.30 & 116.17 & 117.91 & 119.55 & 121.07 & 122.50 & 123.83 & 125.07 & 126.24 & 127.32 & 128.34 & 129.29 & 130.18 & 131.01 & 131.78 & 132.51 & 133.18 & 133.82 & 134.41 & 134.96 & 135.48 & 135.96 & 136.41 & 136.83 & 137.23 \\
8\% & 101.85 & 103.57 & 105.15 & 106.62 & 107.99 & 109.25 & 110.41 & 111.49 & 112.49 & 113.42 & 114.28 & 115.07 & 115.81 & 116.49 & 117.12 & 117.70 & 118.24 & 118.74 & 119.21 & 119.64 & 120.03 & 120.40 & 120.74 & 121.06 & 121.35 & 121.62 & 121.87 & 122.10 & 122.32 & 122.52 \\
9\% & 100.92 & 101.76 & 102.53 & 103.24 & 103.89 & 104.49 & 105.03 & 105.53 & 106.00 & 106.42 & 106.81 & 107.16 & 107.49 & 107.79 & 108.06 & 108.31 & 108.54 & 108.76 & 108.95 & 109.13 & 109.29 & 109.44 & 109.58 & 109.71 & 109.82 & 109.93 & 110.03 & 110.12 & 110.20 & 110.27 \\
10\% & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 \\
11\% & 99.10 & 98.29 & 97.56 & 96.90 & 96.30 & 95.77 & 95.29 & 94.85 & 94.46 & 94.11 & 93.79 & 93.51 & 93.25 & 93.02 & 92.81 & 92.62 & 92.45 & 92.30 & 92.16 & 92.04 & 91.92 & 91.82 & 91.73 & 91.65 & 91.58 & 91.51 & 91.45 & 91.40 & 91.35 & 91.31 \\
12\% & 98.21 & 96.62 & 95.20 & 93.93 & 92.79 & 91.78 & 90.87 & 90.06 & 89.34 & 88.70 & 88.12 & 87.61 & 87.15 & 86.74 & 86.38 & 86.05 & 85.76 & 85.50 & 85.27 & 85.06 & 84.88 & 84.71 & 84.56 & 84.43 & 84.31 & 84.21 & 84.11 & 84.03 & 83.96 & 83.89 \\
13\% & 97.35 & 95.00 & 92.92 & 91.08 & 89.45 & 88.01 & 86.73 & 85.60 & 84.61 & 83.72 & 82.94 & 82.25 & 81.63 & 81.09 & 80.61 & 80.19 & 79.81 & 79.48 & 79.19 & 78.93 & 78.70 & 78.49 & 78.31 & 78.15 & 78.01 & 77.88 & 77.77 & 77.68 & 77.59 & 77.51 \\
14\% & 96.49 & 93.41 & 90.71 & 88.35 & 86.27 & 84.45 & 82.85 & 81.44 & 80.21 & 79.14 & 78.19 & 77.36 & 76.63 & 75.99 & 75.43 & 74.94 & 74.51 & 74.13 & 73.80 & 73.51 & 73.25 & 73.03 & 72.83 & 72.66 & 72.51 & 72.38 & 72.26 & 72.16 & 72.07 & 71.99 \\
15\% & 95.65 & 91.87 & 88.58 & 85.73 & 83.24 & 81.08 & 79.20 & 77.56 & 76.14 & 74.91 & 73.83 & 72.90 & 72.08 & 71.38 & 70.76 & 70.23 & 69.76 & 69.36 & 69.01 & 68.70 & 68.44 & 68.21 & 68.01 & 67.83 & 67.68 & 67.55 & 67.43 & 67.33 & 67.25 & 67.17 \\
16\% & 94.83 & 90.37 & 86.52 & 83.21 & 80.35 & 77.89 & 75.77 & 73.94 & 72.36 & 71.00 & 69.83 & 68.82 & 67.95 & 67.19 & 66.55 & 65.99 & 65.51 & 65.09 & 64.74 & 64.43 & 64.16 & 63.93 & 63.73 & 63.56 & 63.42 & 63.29 & 63.18 & 63.09 & 63.01 & 62.94 \\
17\% & 94.02 & 88.90 & 84.53 & 80.80 & 77.60 & 74.88 & 72.54 & 70.55 & 68.85 & 67.39 & 66.15 & 65.08 & 64.17 & 63.39 & 62.73 & 62.16 & 61.68 & 61.26 & 60.91 & 60.61 & 60.35 & 60.13 & 59.94 & 59.77 & 59.64 & 59.52 & 59.42 & 59.33 & 59.26 & 59.19 \\
18\% & 93.22 & 87.47 & 82.61 & 78.48 & 74.98 & 72.02 & 69.51 & 67.38 & 65.58 & 64.05 & 62.75 & 61.65 & 60.72 & 59.94 & 59.27 & 58.70 & 58.22 & 57.81 & 57.47 & 57.18 & 56.93 & 56.72 & 56.54 & 56.39 & 56.26 & 56.16 & 56.06 & 55.99 & 55.92 & 55.87 \\
19\% & 92.44 & 86.08 & 80.74 & 76.25 & 72.48 & 69.31 & 66.65 & 64.41 & 62.53 & 60.95 & 59.62 & 58.51 & 57.57 & 56.78 & 56.12 & 55.56 & 55.09 & 54.70 & 54.37 & 54.09 & 53.86 & 53.66 & 53.50 & 53.36 & 53.24 & 53.15 & 53.06 & 52.99 & 52.94 & 52.89 \\
20\% & 91.67 & 84.72 & 78.94 & 74.11 & 70.09 & 66.74 & 63.95 & 61.63 & 59.69 & 58.08 & 56.73 & 55.61 & 54.67 & 53.89 & 53.25 & 52.70 & 52.25 & 51.88 & 51.57 & 51.30 & 51.09 & 50.91 & 50.75 & 50.63 & 50.52 & 50.44 & 50.36 & 50.30 & 50.25 & 50.21\\
\bottomrule
\end{tabular}
\bigskip
\caption[test4]{test4}
\begin{tabular}{@{} l *{30}{d{3.2}} @{}}
\toprule
YTM & \mc{1Y} & \mc{2Y} & \mc{3Y} & \mc{4Y} & \mc{5Y} & \mc{6Y} & \mc{7Y} & \mc{8Y} & \mc{9Y} & \mc{10Y} & \mc{11Y} & \mc{12Y} & \mc{13Y} & \mc{14Y} & \mc{15Y} & \mc{16Y} & \mc{17Y} & \mc{18Y} & \mc{18Y} & \mc{20Y} & \mc{21Y} & \mc{22Y} & \mc{23Y} & \mc{24Y} & \mc{25Y} & \mc{26Y} & \mc{27Y} & \mc{28Y} & \mc{29Y} & \mc{30Y} \\
\midrule
0\% & 90.91 & 82.64 & 75.13 & 68.30 & 62.09 & 56.45 & 51.32 & 46.65 & 42.41 & 38.55 & 35.05 & 31.86 & 28.97 & 26.33 & 23.94 & 21.76 & 19.78 & 17.99 & 16.35 & 14.86 & 13.51 & 12.28 & 11.17 & 10.15 & 9.23 & 8.39 & 7.63 & 6.93 & 6.30 & 5.73 \\
1\% & 91.82 & 84.38 & 77.62 & 71.47 & 65.88 & 60.80 & 56.18 & 51.99 & 48.17 & 44.70 & 41.54 & 38.68 & 36.07 & 33.70 & 31.55 & 29.59 & 27.81 & 26.19 & 24.72 & 23.38 & 22.16 & 21.06 & 20.05 & 19.14 & 18.31 & 17.55 & 16.86 & 16.24 & 15.67 & 15.16 \\
2\% & 92.73 & 86.12 & 80.11 & 74.64 & 69.67 & 65.16 & 61.05 & 57.32 & 53.93 & 50.84 & 48.04 & 45.49 & 43.17 & 41.07 & 39.15 & 37.41 & 35.83 & 34.39 & 33.08 & 31.89 & 30.81 & 29.83 & 28.93 & 28.12 & 27.38 & 26.71 & 26.10 & 25.55 & 25.04 & 24.58 \\
3\% & 93.64 & 87.85 & 82.59 & 77.81 & 73.46 & 69.51 & 65.92 & 62.66 & 59.69 & 56.99 & 54.53 & 52.30 & 50.28 & 48.43 & 46.76 & 45.23 & 43.85 & 42.59 & 41.45 & 40.41 & 39.46 & 38.60 & 37.82 & 37.11 & 36.46 & 35.87 & 35.34 & 34.85 & 34.41 & 34.01 \\
4\% & 94.55 & 89.59 & 85.08 & 80.98 & 77.26 & 73.87 & 70.79 & 67.99 & 65.45 & 63.13 & 61.03 & 59.12 & 57.38 & 55.80 & 54.36 & 53.06 & 51.87 & 50.79 & 49.81 & 48.92 & 48.11 & 47.37 & 46.70 & 46.09 & 45.54 & 45.03 & 44.58 & 44.16 & 43.78 & 43.44 \\
5\% & 95.45 & 91.32 & 87.57 & 84.15 & 81.05 & 78.22 & 75.66 & 73.33 & 71.20 & 69.28 & 67.52 & 65.93 & 64.48 & 63.17 & 61.97 & 60.88 & 59.89 & 58.99 & 58.18 & 57.43 & 56.76 & 56.14 & 55.58 & 55.08 & 54.61 & 54.20 & 53.81 & 53.47 & 53.15 & 52.87 \\
6\% & 96.36 & 93.06 & 90.05 & 87.32 & 84.84 & 82.58 & 80.53 & 78.66 & 76.96 & 75.42 & 74.02 & 72.75 & 71.59 & 70.53 & 69.58 & 68.71 & 67.91 & 67.19 & 66.54 & 65.95 & 65.41 & 64.91 & 64.47 & 64.06 & 63.69 & 63.36 & 63.05 & 62.77 & 62.52 & 62.29 \\
7\% & 97.27 & 94.79 & 92.54 & 90.49 & 88.63 & 86.93 & 85.39 & 84.00 & 82.72 & 81.57 & 80.51 & 79.56 & 78.69 & 77.90 & 77.18 & 76.53 & 75.94 & 75.40 & 74.91 & 74.46 & 74.05 & 73.69 & 73.35 & 73.05 & 72.77 & 72.52 & 72.29 & 72.08 & 71.89 & 71.72 \\
8\% & 98.18 & 96.53 & 95.03 & 93.66 & 92.42 & 91.29 & 90.26 & 89.33 & 88.48 & 87.71 & 87.01 & 86.37 & 85.79 & 85.27 & 84.79 & 84.35 & 83.96 & 83.60 & 83.27 & 82.97 & 82.70 & 82.46 & 82.23 & 82.03 & 81.85 & 81.68 & 81.53 & 81.39 & 81.26 & 81.15 \\
9\% & 99.09 & 98.26 & 97.51 & 96.83 & 96.21 & 95.64 & 95.13 & 94.67 & 94.24 & 93.86 & 93.50 & 93.19 & 92.90 & 92.63 & 92.39 & 92.18 & 91.98 & 91.80 & 91.64 & 91.49 & 91.35 & 91.23 & 91.12 & 91.02 & 90.92 & 90.84 & 90.76 & 90.69 & 90.63 & 90.57 \\
10\% & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 & 100.00 \\
11\% & 100.91 & 101.74 & 102.49 & 103.17 & 103.79 & 104.36 & 104.87 & 105.33 & 105.76 & 106.14 & 106.50 & 106.81 & 107.10 & 107.37 & 107.61 & 107.82 & 108.02 & 108.20 & 108.36 & 108.51 & 108.65 & 108.77 & 108.88 & 108.98 & 109.08 & 109.16 & 109.24 & 109.31 & 109.37 & 109.43 \\
12\% & 101.82 & 103.47 & 104.97 & 106.34 & 107.58 & 108.71 & 109.74 & 110.67 & 111.52 & 112.29 & 112.99 & 113.63 & 114.21 & 114.73 & 115.21 & 115.65 & 116.04 & 116.40 & 116.73 & 117.03 & 117.30 & 117.54 & 117.77 & 117.97 & 118.15 & 118.32 & 118.47 & 118.61 & 118.74 & 118.85 \\
13\% & 102.73 & 105.21 & 107.46 & 109.51 & 111.37 & 113.07 & 114.61 & 116.00 & 117.28 & 118.43 & 119.49 & 120.44 & 121.31 & 122.10 & 122.82 & 123.47 & 124.06 & 124.60 & 125.09 & 125.54 & 125.95 & 126.31 & 126.65 & 126.95 & 127.23 & 127.48 & 127.71 & 127.92 & 128.11 & 128.28 \\
14\% & 103.64 & 106.94 & 109.95 & 112.68 & 115.16 & 117.42 & 119.47 & 121.34 & 123.04 & 124.58 & 125.98 & 127.25 & 128.41 & 129.47 & 130.42 & 131.29 & 132.09 & 132.81 & 133.46 & 134.05 & 134.59 & 135.09 & 135.53 & 135.94 & 136.31 & 136.64 & 136.95 & 137.23 & 137.48 & 137.71 \\
15\% & 104.55 & 108.68 & 112.43 & 115.85 & 118.95 & 121.78 & 124.34 & 126.67 & 128.80 & 130.72 & 132.48 & 134.07 & 135.52 & 136.83 & 138.03 & 139.12 & 140.11 & 141.01 & 141.82 & 142.57 & 143.24 & 143.86 & 144.42 & 144.92 & 145.39 & 145.80 & 146.19 & 146.53 & 146.85 & 147.13 \\
16\% & 105.45 & 110.41 & 114.92 & 119.02 & 122.74 & 126.13 & 129.21 & 132.01 & 134.55 & 136.87 & 138.97 & 140.88 & 142.62 & 144.20 & 145.64 & 146.94 & 148.13 & 149.21 & 150.19 & 151.08 & 151.89 & 152.63 & 153.30 & 153.91 & 154.46 & 154.97 & 155.42 & 155.84 & 156.22 & 156.56 \\
17\% & 106.36 & 112.15 & 117.41 & 122.19 & 126.54 & 130.49 & 134.08 & 137.34 & 140.31 & 143.01 & 145.47 & 147.70 & 149.72 & 151.57 & 153.24 & 154.77 & 156.15 & 157.41 & 158.55 & 159.59 & 160.54 & 161.40 & 162.18 & 162.89 & 163.54 & 164.13 & 164.66 & 165.15 & 165.59 & 165.99 \\
18\% & 107.27 & 113.88 & 119.89 & 125.36 & 130.33 & 134.84 & 138.95 & 142.68 & 146.07 & 149.16 & 151.96 & 154.51 & 156.83 & 158.93 & 160.85 & 162.59 & 164.17 & 165.61 & 166.92 & 168.11 & 169.19 & 170.17 & 171.07 & 171.88 & 172.62 & 173.29 & 173.90 & 174.45 & 174.96 & 175.42 \\
19\% & 108.18 & 115.62 & 122.38 & 128.53 & 134.12 & 139.20 & 143.82 & 148.01 & 151.83 & 155.30 & 158.46 & 161.32 & 163.93 & 166.30 & 168.45 & 170.41 & 172.19 & 173.81 & 175.28 & 176.62 & 177.84 & 178.94 & 179.95 & 180.86 & 181.69 & 182.45 & 183.14 & 183.76 & 184.33 & 184.84 \\
20\% & 109.09 & 117.36 & 124.87 & 131.70 & 137.91 & 143.55 & 148.68 & 153.35 & 157.59 & 161.45 & 164.95 & 168.14 & 171.03 & 173.67 & 176.06 & 178.24 & 180.22 & 182.01 & 183.65 & 185.14 & 186.49 & 187.72 & 188.83 & 189.85 & 190.77 & 191.61 & 192.37 & 193.07 & 193.70 & 194.27 \\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}
Best Answer
@Hadson, Code in your link is far from a MWE ... Anyway, you have two problems:
For show what I do, I made from your code the following MWE:
For first two table it was enough to erase empy line between the. For quick test I made distance between them with
quad
. Instead it you can usehfill
associated with\centering
command after\begin{table}
.For second two table was my suspect in comment right. They are to wide. So, you see how to make columns with heads
Liczba okresów k
andCzas t[s] dla k okresów
narrower. One way to do this is typeset them in more lines as I do in above MWE: in preamble add packagemakecell
and then use its macrothead
.As you can see, I add to tables option
[t]
for aligning on top (since the first two are of different heights). Pictures of both tables after aforementioned suggestions: