I would like to produce a table in Latex that looks like the one below. Basically, I don't know how to not put a border around the first column.
2 Answers
I will assume that you're familiar with the basics of creating a table with a tabular
environment.
Taking the example of a five-column table, you may achieve your formatting objective by (a) not specifying |
to the left of the first column type specifier (here: c
for centering) and (b) using \cline{2-5}
instead of \hline
.
\documentclass{article} % or some other suitable document class
\usepackage{array}
\setlength\extrarowheight{2pt} % optional, for a less-cramped "look"
\begin{document}
\begin{table}[ht]
\centering % horizontal centering inside text block
\begin{tabular}{c|c|c|c|c|}
\cline{2-5}
Alice & Test 1 & Test 1 & Test 1 & Test 1 \\ \cline{2-5}
Cooper & Test 2 & Test 2 & Test 2 & Test 2 \\ \cline{2-5}
Eric & Test 3 & Test 3 & Test 3 & Test 3 \\ \cline{2-5}
Clapton & Test 4 & Test 4 & Test 4 & Test 4 \\ \cline{2-5}
\end{tabular}
\end{table}
\end{document}
-
Many thanks - perfect, it was the cline I didn't know about. Commented Apr 30, 2023 at 2:28
Just to inform you for another possibilities how to write your table. By use of tabularray
package he code for table is quite simple:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{table}[ht]
\centering
\begin{tblr}{hline{1-Z}={2-Z}{solid}, vline{2-Z}={1-Z}{solid},
colspec={ccccc}
}
Alice & Test 1 & Test 1 & Test 1 & Test 1 \\
Cooper & Test 2 & Test 2 & Test 2 & Test 2 \\
Eric & Test 3 & Test 3 & Test 3 & Test 3 \\
Clapton & Test 4 & Test 4 & Test 4 & Test 4 \\
\end{tblr}
\end{table}
\end{document}
-
-
@GaryHoran, instead said "thanks", you can upvote answer :-)– ZarkoCommented Apr 30, 2023 at 11:32