I am trying to align column 1 row 1 and column 2 row 1 better (independently) (specifically the Time and seconds, x and also the height and feet, y. You can see each is off center a bit. I am unable to figure out how to center them better. Any help would be much appreciated.
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{Tabular Example}
\author{nbennett }
\date{June 2022}
\begin{document}
\maketitle
\section{Table}
\begin{tabular}{|c|c|}
\hline
\vtop{\hbox{\strut Time}\hbox{\strut (seconds), \(x\)}}&\vtop{\hbox{\strut Height}\hbox{\strut (feet), \(y\)}}\\
\hline
0&8 \\ \hline
0.5 & 20 \\ \hline
1 & 24 \\ \hline
1.5 & 20 \\ \hline
2 & 8 \\ \hline
\hline
\end{tabular}
\end{document}
c
option will automatically center each cell content. Can you post a description of what you want? Also: use of\vtop
and\strut
... probably not the best idea.\vtop
and\strut
prevents it.\hbox
so it will not be centered within the vbox, but the vbox as a whole is centred in the column