1
votes

I am trying to draw a 6 column table in LaTeX which fits normal page margins, and which has the data centered under each column heading. Wrapping of column headings is fine. I have spent the last 3 hours reading various threads of answers, and it seems there is a different solution for each question related to drawing a table. As a result I am lost on how to do it. My table presently extends off the page margin to the right. I am not permitted to use any packages like tabularx, etc., so the table must be drawn in the tabular environment, and no additional packages are loaded in the document above the begin table call. Here is the present code used to draw the table:

\begin{table}
\caption{Experimental Details for PRE1}
\centering
\begin{tabular}{cccccc}
\hline
PRE1 Interval & Elapsed Time (min) & Flow (lps) & Sediment Feed (kg/min) & Avg. Flux (kg/min) & DEM/Photo\\
\hline
1 & 19 & 42 & 0.50 & 0.009 & yes\\
2 & 50 & 42 & 0.50 &  0.027 & yes \\
3 & 110 & 42 & 0.50 & 0.064 & yes \\
4 & 230 & 42 & 0.50 & 0.048 & yes \\
5 & 470 & 42 & 0.50 & 0.027 & yes \\
6 & 710 & 42 & 0.50 & 0.050 & yes \\
7 & 950 & 42 & 0.50 & 0.030 & yes \\
8 & 1190 & 42 & 0.50 & 0.016 & yes \\
9 & 1430 & 42 & 0.50 & 0.099 & yes \\
10 & 1670 & 42 & 0.50 & 0.058 & yes \\
11 & 1910 & 42 & 0.50 & 0.055 & yes \\
12 & 2150 & 42 & 0.50 & 0.031 & yes \\
13a & 2180 & 60 & 0.50 & 4.284 & no \\
13b & 2195 & 60 & 0.80 & 7.113 & no \\
13c & 2225 & 60 & 0.80 & 3.670 & yes \\
14a & 2270 & 60 & 0.80 & 2.296 & no \\
14b & 2390 & 60 & 0.80 & 0.917 & yes \\
15a & 2405 & 80 & 1.00 & 3.848 & no \\
15b & 2429 & 80 & 1.00 & 3.840 & no \\
15c & 2450 & 80 & 1.00 & 3.303 & yes \\
16a & 2480 & 80 & 1.00 & 2.554 & no \\
16b & 2525 & 80 & 1.00 & 1.336 & no \\
16c & 2570 & 80 & 1.00 & 0.927 & yes \\
17 & 2630 & 80 & 1.00 & 1.067 & yes \\
18 & 2870 & 42 & 0.50 & 0.033 & yes \\
19 & 3110 & 42 & 0.50 & 0.016 & yes \\
20 & 3350 & 42 & 0.50 & 0.013 & yes \\
21 & 3590 & 42 & 0.50 & 0.018 & yes \\
22 & 3830 & 42 & 0.50 & 0.022 & yes \\
23 & 4070 & 42 & 0.50 & 0.143 & yes \\
24 & 4310 & 42 & 0.50 & 0.509 & yes \\
25a & 4336 & 60 & 0.80 & 4.488 & no \\
25b & 4351 & 60 & 0.80 & 9.622 & no \\
25c & 4370 & 60 & 0.80 & 5.479 & no \\
25d & 4385 & 60 & 0.80 & 4.527 & yes \\
26a & 4430 & 60 & 0.80 & 2.436 & no \\
26b & 4550 & 60 & 0.80 & 0.595 & yes \\
27a & 4565 & 80 & 0.80 & 2.231 & no \\
27b & 4589 & 80 & 0.80 & 6.212 & no \\
27c & 4610 & 80 & 0.80 & 5.062 & yes \\
28a & 4640 & 80 & 0.80 & 2.069 & no \\
28b & 4685 & 80 & 0.80 & 1.132 & no \\
28c & 4730 & 80 & 0.80 & 0.892 & yes \\
29 & 4790 & 80 & 0.80 & 0.600 & yes \\
\hline
\multicolumn{2}{l}{$^{a}$The repeat phase of PRE1 began at elapse time 2630 minutes.}\\
\multicolumn{2}{l}{$^{b}$The elapse time indicates the end time for the specified experimental interval.}
\label{tab1}
\end{tabular}
\end{table}

I attempted to use the following type of syntax from the Wikibooks help page as the columns could be treated as identical, but with no luck:

\begin{tabular}{l*{6}{c}r}

I would appreciate any help that can be offered. Thanks in advance.

1

1 Answers

1
votes

I figured my problem. The difficulty was with the footnotes. In the footnotes I was only specifying a value of 2 for the first multicolumn argument, and thus columns 3-6 were getting shoved to the right depending on how much text was in footnotes a and b. Here is the corrected working code.

\begin{table}
\caption{Experimental Details for PRE1}
\centering
\begin{tabular}{l*{5}{c}r}
\hline
PRE1 Interval & Elapsed Time (min) & Flow (lps) & Sediment Feed (kg/min) & Avg. Flux (kg/min) & DEM/Photo\\
\hline
0 & 0 & - & - & - & yes\\
1 & 19 & 42 & 0.50 & 0.009 & yes\\
2 & 50 & 42 & 0.50 &  0.027 & yes \\
3 & 110 & 42 & 0.50 & 0.064 & yes \\
4 & 230 & 42 & 0.50 & 0.048 & yes \\
5 & 470 & 42 & 0.50 & 0.027 & yes \\
6 & 710 & 42 & 0.50 & 0.050 & yes \\
7 & 950 & 42 & 0.50 & 0.030 & yes \\
8 & 1190 & 42 & 0.50 & 0.016 & yes \\
9 & 1430 & 42 & 0.50 & 0.099 & yes \\
10 & 1670 & 42 & 0.50 & 0.058 & yes \\
11 & 1910 & 42 & 0.50 & 0.055 & yes \\
12 & 2150 & 42 & 0.50 & 0.031 & yes \\
13a & 2180 & 60 & 0.50 & 4.284 & no \\
13b & 2195 & 60 & 0.80 & 7.113 & no \\
13c & 2225 & 60 & 0.80 & 3.670 & yes \\
14a & 2270 & 60 & 0.80 & 2.296 & no \\
14b & 2390 & 60 & 0.80 & 0.917 & yes \\
15a & 2405 & 80 & 1.00 & 3.848 & no \\
15b & 2429 & 80 & 1.00 & 3.840 & no \\
15c & 2450 & 80 & 1.00 & 3.303 & yes \\
16a & 2480 & 80 & 1.00 & 2.554 & no \\
16b & 2525 & 80 & 1.00 & 1.336 & no \\
16c & 2570 & 80 & 1.00 & 0.927 & yes \\
17 & 2630 & 80 & 1.00 & 1.067 & yes \\
18 & 2870 & 42 & 0.50 & 0.033 & yes \\
19 & 3110 & 42 & 0.50 & 0.016 & yes \\
20 & 3350 & 42 & 0.50 & 0.013 & yes \\
21 & 3590 & 42 & 0.50 & 0.018 & yes \\
22 & 3830 & 42 & 0.50 & 0.022 & yes \\
23 & 4070 & 42 & 0.50 & 0.143 & yes \\
24 & 4310 & 42 & 0.50 & 0.509 & yes \\
25a & 4336 & 60 & 0.80 & 4.488 & no \\
25b & 4351 & 60 & 0.80 & 9.622 & no \\
25c & 4370 & 60 & 0.80 & 5.479 & no \\
25d & 4385 & 60 & 0.80 & 4.527 & yes \\
26a & 4430 & 60 & 0.80 & 2.436 & no \\
26b & 4550 & 60 & 0.80 & 0.595 & yes \\
27a & 4565 & 80 & 0.80 & 2.231 & no \\
27b & 4589 & 80 & 0.80 & 6.212 & no \\
27c & 4610 & 80 & 0.80 & 5.062 & yes \\
28a & 4640 & 80 & 0.80 & 2.069 & no \\
28b & 4685 & 80 & 0.80 & 1.132 & no \\
28c & 4730 & 80 & 0.80 & 0.892 & yes \\
29 & 4790 & 80 & 0.80 & 0.600 & yes \\
\hline
\multicolumn{6}{l}{$^{a}$The repeat phase of PRE1 began at elapse time 2630 minutes.}\\
\multicolumn{6}{l}{$^{b}$The elapse time indicates the end time for the   specified experimental interval.}
\label{tab1}
\end{tabular}
\end{table}

Note that I used the multiple identical columns solution in the \begin{tabular} call. here is an image of the corrected table. This question has been answered.