# LaTeX table adjustments

I am typing the following table in LaTeX:

\begin{center}
\setlength\extrarowheight{5pt}
%\renewcommand{\arraystretch}{1.2}
\begin{tabular*}{3.4in}{@{\extracolsep{\fill} }  | c | c | c | c | c | c | c | }
\hline
\small\textit{g(t+0)} & \small\textit{g(t+1)} & \small\textit{g(t+2)} & \small\textit{f(t+3)} & \small\textit{f(t+4)} & \small\textit{g(t+5)} & \small{...}  \\
\hline
\end{tabular*}
\end{center}


I get the following output:

1. Note the overlap on the left. How can I remove them?
2. How do I adjust the fonts to be centered in the middle of the columns other than on the bottom?
• You don't need to use tabular*. It's enough to use tabular. – Marco Daniel Feb 8 '14 at 8:49
• – Marco Daniel Feb 8 '14 at 8:52

## 2 Answers

Add half the spacing through \extrarowheight and half when you break the row.

Also, you can use tabular instead of tabular*.

To fix the overlap on the left note that you have a spurious space in

@{\extracolsep{\fill} }


MWE

\documentclass{article}
\usepackage{array}

\begin{document}

\begin{center}
\setlength\extrarowheight{2.5pt}
%\renewcommand{\arraystretch}{1.2}
\begin{tabular}{@{\extracolsep{\fill}}  | c | c | c | c | c | c | c | }
\hline
\small\textit{g(t+0)} & \small\textit{g(t+1)} & \small\textit{g(t+2)} & \small\textit{f(t+3)} & \small\textit{f(t+4)} & \small\textit{g(t+5)} & \small{...}\\[2.5pt]
\hline
\end{tabular}
\end{center}
\end{document}


Output

• also i want the overlap on the left hand side to be shifted to the right – user1965914 Feb 8 '14 at 8:55
• @user1965914 See if now it is OK. – karlkoeller Feb 8 '14 at 9:04

use a simple tabular or tabularx:

\documentclass{article}
\usepackage{tabularx}
\begin{document}

foo

{\small\itshape
\begin{tabular}{|*7{c|}}  \hline
\rule[-2ex]{0pt}{6ex} g(t+0) & g(t+1) & g(t+2) & f(t+3) & f(t+4) & g(t+5) & \ldots\\\hline
\end{tabular}}

{\small\itshape
\begin{tabularx}{3.8in}{|*6{X |}c|}  \hline
\rule[-2ex]{0pt}{6ex} g(t+0) & g(t+1) & g(t+2) & f(t+3) & f(t+4) & g(t+5) & \ldots\\\hline
\end{tabularx}}

bar
\end{document}