1

Snapshot

I have these tables in an article which I need to be of the article column width with equal columns, or whatever looks the best. I also would like to not put a full line break between the rows, but they will blend into each other if I do not. Also, I need to create a caption for the table and the header looks squished...

    \documentclass[letterpaper]{article}
    \usepackage{aaai}
    \usepackage{times}
    \usepackage{helvet}
    \usepackage{courier}
    \usepackage{graphicx}
    \usepackage{array}
    \newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}
    \graphicspath{ {images/} }
    \frenchspacing
    \setlength{\pdfpagewidth}{8.5in}
    \setlength{\pdfpageheight}{11in}

     \begin{document}
    The random Feature set consists of eleven predictors which were chosen at random from the Sustainability Base Building 232 dataset.
   \begin{table}
\begin{tabular}{c L c}
\hline
Index&Description&Object Type \\\hline\\
A&232 RF1 HWS VALVE 14&Binary Output \\\\
B&232 A1 DX CAP SIGNAL&Analog Output \\\\
C&232 RSB P1 START/STOP&Binary Output\\\\
D&232 CRCP VALVE S28A&Analog Output\\\\
E&232 GWRV LOOPOUT&Analog Value \\\\
F&232 M1 AVG FLOW&Analog Value\\\\
G&232 ZONE N121 N125 AVERAGE TEM&Analog Value \\\\
H&232 S1 DPT AVG C&Analog Value\\\\
I&232 HP3 HEAT STAGE TIMER&Analog Value\\\\
J&232 N1 COOLING OFF&Analog Value\\\\
\hline
\end{tabular}
\end{table}
\begin{table}
\begin{tabular}{c c c c c c c}
\hline
&Min&1st Qu&Median&Mean&3rd Qu&Max \\\hline
&0.00E+00&0.00E+00&0.00E+00&3.83E-01&1.00E+00&1.00E+00 \\\\
&0.00E+00&0.00E+00&0.00E+00&8.84E-01&0.00E+00&5.00E+00 \\\\
&0.00E+00&0.00E+00&0.00E+00&3.83E-01&1.00E+00&1.00E+00  \\\\
&0.00E+00&2.00E-05&1.83E-01&1.19E+01&6.02E-01&1.00E+02  \\\\
&0.00E+00&5.23E-01&7.72E+01&5.16E+01&9.95E+01&1.00E+02 \\\\
&1.49E+03&1.86E+03&1.91E+03&2.09E+03&2.34E+03&3.06E+03  \\\\
&6.69E+01&7.15E+01&7.27E+01&7.30E+01&7.47E+01&7.88E+01  \\\\
&3.00E+01&4.25E+01&4.85E+01&4.76E+01&5.25E+01&5.90E+01  \\\\
&0.00E+00&1.00E+04&1.00E+04&8.12E+03&1.00E+04&1.00E+04  \\\\
&7.30E+01&7.40E+01&7.40E+01&7.40E+01&7.40E+01&7.40E+01  \\\\
\end{tabular}
\end{table}
    \end{document}
2
  • In the title you say your question refers to twocolumn mode, but your example doesn't load the twocolumn option. What is the case? Regarding your question you should have a look at the tabularx package. It has been designed to create tables with a fixed width. – Ruben Apr 18 '16 at 23:22
  • 1
    The aaai package dates back to latex 2.09 (1988!) and isn't in TeX Live nor MiKTeX. The TeX Catalogue on Line says it's not compatible with the present versions of LaTeX. – Bernard Apr 18 '16 at 23:36
2
  • For the first table, I recommend you employ a tabularx environment, with the middle column given a centered version of the X column type. ]]
  • For the second column, I suggest (a) use a tabular* environment, (b) use math-mode + and - signs, (c) reduce the font size by 10% by using the directive \small, and (d) show only one rather than two digits in the exponent component. (If you prefer to show two-digit exponents, you will need to use \footnotesize instead of \small.)
  • For both tables, I suggest you not use extra blank lines throughout. Instead, consider increasing the value of \arraystretch. In the following example, I've set \arraystretch to 1.65 for both tables; feel free to adjust this parameter to your liking.

(For the following screenshot, I used the [h!] positioning specifier for both tables. In your real document, you may want to remove these specifiers.)

enter image description here

\documentclass[letterpaper,twocolumn]{article}
    %\usepackage{aaai}  % 
    \usepackage{mathptmx} % Times Roman for text *and* math
    \usepackage[scaled]{helvet}
    \usepackage{courier}
    \frenchspacing
    \usepackage{booktabs,tabularx}
    \newcolumntype{C}{>{\centering\arraybackslash}X}
%    \setlength{\pdfpagewidth}{8.5in}
%    \setlength{\pdfpageheight}{11in}

\begin{document}

The random feature set consists of eleven predictors which were chosen at random from the Sustainability Base Building 232 dataset.

\begin{table}[h!]
\renewcommand\arraystretch{1.65}
\begin{tabularx}{\columnwidth}{@{}cCc@{}}
\toprule
Index&Description&Object Type \\
\midrule
A&232 RF1 HWS VALVE 14&Binary Output \\
B&232 A1 DX CAP SIGNAL&Analog Output \\
C&232 RSB P1 START\slash STOP&Binary Output\\
D&232 CRCP VALVE S28A&Analog Output\\
E&232 GWRV LOOPOUT&Analog Value \\
F&232 M1 AVG FLOW&Analog Value\\
G&232 ZONE N121 N125 AVERAGE TEM&Analog Value \\
H&232 S1 DPT AVG C&Analog Value\\
I&232 HP3 HEAT STAGE TIMER&Analog Value\\
J&232 N1 COOLING OFF&Analog Value\\
\bottomrule
\end{tabularx}
\end{table}

\begin{table}[h!]
\renewcommand\arraystretch{1.65}
\setlength\tabcolsep{0pt}
\small
\begin{tabular*}{\columnwidth}{c @{\extracolsep{\fill}} ccccc}
\toprule
Min&1st Qu&Median&Mean&3rd Qu&Max \\
\midrule
0.00E$+$0&0.00E$+$0&0.00E$+$0&3.83E$-$1&1.00E$+$0&1.00E$+$0  \\
0.00E$+$0&0.00E$+$0&0.00E$+$0&8.84E$-$1&0.00E$+$0&5.00E$+$0  \\
0.00E$+$0&0.00E$+$0&0.00E$+$0&3.83E$-$1&1.00E$+$0&1.00E$+$0  \\
0.00E$+$0&2.00E$-$5&1.83E$-$1&1.19E$+$1&6.02E$-$1&1.00E$+$2  \\
0.00E$+$0&5.23E$-$1&7.72E$+$1&5.16E$+$1&9.95E$+$1&1.00E$+$2  \\
1.49E$+$3&1.86E$+$3&1.91E$+$3&2.09E$+$3&2.34E$+$3&3.06E$+$3  \\
6.69E$+$1&7.15E$+$1&7.27E$+$1&7.30E$+$1&7.47E$+$1&7.88E$+$1  \\
3.00E$+$1&4.25E$+$1&4.85E$+$1&4.76E$+$1&5.25E$+$1&5.90E$+$1  \\
0.00E$+$0&1.00E$+$4&1.00E$+$4&8.12E$+$3&1.00E$+$4&1.00E$+$4  \\
7.30E$+$1&7.40E$+$1&7.40E$+$1&7.40E$+$1&7.40E$+$1&7.40E$+$1  \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
0

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.