I made a table spanning the top of a two column page, but there is a problem in the last column where $j$ is very close to the hline above, while other elements in the same row are of the same vertical height. The same problem happens to the "transition" header in the last column. And is there a way to make the first row a little wider(the row with $\lambda$ and transition)? How to fix these issues?
\newcolumntype{M}{>{\centering\arraybackslash}m{\dimexpr.096\linewidth-2\tabcolsep}}
\begin{table*}[t!]
\footnotesize
\centering
\begin{tabular}{|| M | M || M | M || M | M || M | M || M | M ||}
\multicolumn{2}{c}{\bf Lyman} & \multicolumn{2}{c}{\bf Balmer} & \multicolumn{2}{c}{\bf Paschen} & \multicolumn{2}{c}{\bf Brackett} & \multicolumn{2}{c}{\bf Pfund} \\
\hline
$\lambda$(nm) & transition & $\lambda$(nm) & transition & $\lambda$(nm) & transition & $\lambda$(nm) & transition & $\lambda$(nm) & transition \\[1mm]
\hline
93.78 & 6$\rightarrow$1 & 410.2 & 6$\rightarrow$2 & 1094 & 6$\rightarrow$3 & 2630 & 6$\rightarrow$4 & 7400 & 6$\rightarrow$5 \\[1mm]
94.98 & 5$\rightarrow$1 & 434.0 & 5$\rightarrow$2 & 1282 & 5$\rightarrow$3 & 4050 & 5$\rightarrow$4 & & \\[1mm]
97.25 & 4$\rightarrow$1 & 486.1 & 4$\rightarrow$2 & 1875 & 4$\rightarrow$3 & & & & \\[1mm]
102.6 & 3$\rightarrow$1 & 656.3 & 3$\rightarrow$2 & & & & & & \\[1mm]
121.6 & 2$\rightarrow$1 & & & & & & & & \\[1mm]
\hline
$\frac{\lambda_{1,j}}{\lambda_{1,j+1}}$ & $j$ & $\frac{\lambda_{2,j}}{\lambda_{2,j+1}}$ & $j$ & $\frac{\lambda_{3,j}}{\lambda_{3,j+1}}$ & $j$ & $\frac{\lambda_{4,j}}{\lambda_{4,j+1}}$ & $j$ & $\frac{\lambda_{5,j}}{\lambda_{5,j+1}}$ & $j$ \\[4mm]
\hline
1.01 & 5 & 1.05 & 5 & 1.17 & 5 & 1.54 & 5 & & \\[1mm]
1.02 & 4 & 1.12 & 4 & 1.46 & 4 & & & & \\[1mm]
1.05 & 3 & 1.35 & 3 & & & & & & \\[1mm]
1.18 & 2 & & & & & & & & \\[1mm]
\hline
\end{tabular}
\caption{Expected hydrogen wavelengths, transitions and wavelength ratios.}
\end{table*}
Here is the preamble.
\documentclass[aps,prl,reprint,twocolumn,secnumarabic,nobalancelastpage,amsmath,amssymb,nofootinbib]{revtex4}
% nofootinbib is another document class option that allows you to put
% footnotes on the page where they occur rather than at the end of the
% paper. This makes for easier reading!
% secnumarabic is a particularly nice way of identifying sections by
% number to aid electronic review and commentary.
% amsmath and amssymb are necessary for the subequations environment
% among others
\usepackage{graphics} % standard graphics specifications
\usepackage{graphicx} % alternative graphics specifications
\usepackage{longtable} % helps with long table options
\usepackage{url} % for on-line citations
\usepackage{bm} % special 'bold-math' package
\usepackage{comment}
\usepackage{fancyhdr}% http://ctan.org/pkg/{fancyhdr,graphicx,lastpage}
\usepackage{color}
\usepackage{atbegshi}
\usepackage{textcomp}
\usepackage{siunitx}
\usepackage{lipsum}
\usepackage{float}
\usepackage{array}
\usepackage{tabularx} % for 'tabularx' environment
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{booktabs} % for '\toprule', '\midrule', etc
\usepackage{amsmath} % for '\dfrac' macro
\newcommand \widebox [1]{\setlength\fboxsep{6pt} \boxed { #1}}
\newcommand \ev [1]{\left\langle #1 \right\rangle}
\newcommand \evd {\operatorname{E}\evdel}
\newcommand \bbrac [1] {\left ( #1 \right)}
\newcommand \bl {\biggr | }
\newcommand \espa {\\[2.5 mm]}
\newcommand \vbrac [1] {\left [ \,#1 \,\right]}
\newcommand \dpart [2] {\frac{\partial{#1}}{\partial{#2}}}
\newcommand \kai [2] {\chi_{#1}^{\, (#2)}}
\newcommand \ud {\uparrow \,\downarrow}
\newcommand \du {\downarrow\,\uparrow }
\fancyhf{}
\pagestyle{fancy}
\chead{MODERN \,\,\,PHYSICS\,\,\, LABOTORARY \\[-0.9em]}
\lhead{PHYSICS \textbf{18L} \\[-1.1em]}
\rhead{23 APRIL 2015 \\[-1.1em]}
\cfoot{\thepage}
\AtBeginDocument{%
\rfoot{\raisebox{1.5pt}{\scalebox{0.7}{\textcopyright}} 2015 Physics Department}%
\AtBeginShipoutNext{%
\rfoot{}%
}%
}
\renewcommand{\headrulewidth}{1pt}
Best Answer
I wouldn't use the
m
column type for this table. In its place, I would use a centered form of theX
column provide (provided by thetabularx
package), in part to let LaTeX handle the chores of determining column widths. Separately, I'd use the line-drawing macros of thebooktabs
package to get well-spaced horizontal lines; plus, I'd omit all vertical lines.The only "tricky" aspect of the table is that whereas the contents of most cells should be centered, the contents of the first 5 data rows of the first column would benefit from being aligned on the decimal separator. This may be achieved by (i) using the
S
column type (provided by thesiunitx
package) for the first column and (ii) encasing those items in the first column that should be centered in pairs of curly braces.Finally, rather than add 1 mm of extra row height manually to each row, I believe it's easier to set the macro
\extrarowheight
to that value.Addendum The OP has informed me that he/she is using the
revtex4
document class, which appears to be incompatible with thebooktabs
package and its rule-drawing macros. :-(Here's an alternative solution, which works with the
revtex4
document class as well as with many other document classes. It uses atabular*
environment instead of atabularx
environment, and it inserts (typographic) struts at selected locations to obtain a better vertical separation between the lines drawn by\hline
and\cline
and the material above and below the lines.I still wouldn't use any vertical lines with this solution, by the way.