I am using the following codes:
> \begin{table} [h!] \caption{Alcohol- or Drug-Related Arrests By
> Ethnicity, 2017-2020} \label{ASUS_drug_arrest_table} \centering
> \begin{tabular}{|p{4cm}|p{1.7cm}|p{1.7cm}|p{1.7cm}|p{1.7cm}|} \hline
> & 2017 & 2018 & 2019 & 2020\\ \hline White/Caucasian & & & &\\
> \hline Black/African American & & & &\\ \hline Hispanic/Latino
> & & & &\\ \hline Native American & & & &\\ \hline Asian & &
> & &\\ \hline Hawaiian/Part Hawaiian & & & &\\ \hline Other
> Pacific Islander & & & &\\ \hline Other & & & &\\ \hline
> \end{tabular} \end{table}
and getting this output:
I was wondering how the top header representing years can be centered.
&\centering 2017&\centering 2018 & …
.thead
from themakecell
package andbooktabs
for better horizontal lines also removing all verticals\centering
in the last column. You can circumvent it replacing\\ \hline
with\tabularnewline \hline
for the heads row, but as the aim of using this command was to simplify w.r.t. using\multicolumn{1}{c}{…}
, it is debatable.