Protrusion of fractions in tabulars
How about using the dcolumn
package?
\documentclass{article}
\usepackage{xfrac}
\usepackage{dcolumn}
\begin{document}
\newcolumntype{d}{D{.}{\,}{2}}
\newcommand*\mc[2]{\multicolumn{#1}{c|}{#2}}
\begin{tabular}{|r|r|r|d|d|}
\hline
\multicolumn{1}{|c|}{Mile} & \mc{1}{Furlong} & \mc{1}{Pole} & \mc{1}{Yard} & \mc{1}{Foot}\\
\hline
1 & 8 & 320 & 1760 & 5280\\
\hline
\mc{1}{} & 1 & 40 & 220 & 660\\
\cline{2-5}
\mc{2}{} & 1 & 5.\sfrac{1}{2} & 16.\sfrac{1}{2}\\ % note . delimeter
\cline{3-5}
\end{tabular}
\end{document}
This aligns the numbers correctly. The input uses the dot as the marker of where the fraction begins, but using dcolumn
's ability to change the output marker prints a thin space.
This solution will only work if the columns that have fractions don't also have decimals as in your last column in the example. Also, if you know in advance that some columns won't have any decimals, then you could adjust some of those columns to a simple r
column as I did in the example.
\documentclass{article}
\usepackage{array,mathtools}
\newcolumntype{R}{>{$}r<{\phantom{2}$}}
\def\Frac#1#2{\mathrlap{\frac{#1}{#2}}}
\newcommand\mc[2]{\multicolumn{#1}{c|}{#2}}
\begin{document}
\def\arraystretch{1.2}
\begin{tabular}{|*5{R|}}\hline
\multicolumn{1}{|c|}{Mile} & \mc{1}{Furlong} & \mc{1}{Pole} & \mc{1}{Yard} & \mc{1}{Foot}\\\hline
1 & 8 & 320 & 1760 & 5280\\\hline
\mc{1}{} & 1 & 40 & 220 & 660\\\cline{2-5}
\mc{2}{} & 1 & 5\Frac{1}{2} & 16\Frac{1}{2}\\\cline{3-5}
\end{tabular}
\end{document}