1

I can not solve a small problem, starting from this solution, I have done the table below but now I would like to write a word on each column with the type first and second in italics.

For example the word here for second of type 1. But I don't know how to do it for all columns.

I have done this:

\begin{table}[h]
    \centering
    \begin{tabular}{p{1.5cm}p{0.5cm}p{0.5cm}p{0.5cm}}
    type &  1 & 2 & 3 \\ 
    \hline
    \textbf{1}
    \newline \small{\textit{first}} & \\
    \newline \small{\textit{second}} &     here\\
    \textbf{2}  
    \newline \small{first}} &  \\
    \textbf{3} 
    \newline \small{\textit{first}} &  \\
    \end{tabular}
\end{table}

enter image description here

I would like this:

enter image description here

Ted
  • 13

1 Answers1

1

Welcome to TeX.SE!

If I understood you correctly, than you like to have the following table:

enter image description here

It can be simple set as follows:

\documentclass{article}
\usepackage{array}

\begin{document} \begin{table}[h] \centering \begin{tabular}{>{\small}p{1.5cm} *{3}{>{\sffamily}p{0.5cm}} } \normalsize{type} & 1 & 2 & 3 \ \hline \textbf{1} & & & \ \emph{first} & here & here & here \ \emph{second} & here & here & here \ \textbf{2} & & & \ first & here & here & here \ \textbf{3} & & & \ \emph{first} & here & here & here \ \end{tabular} \end{table} \end{document}

Zarko
  • 296,517
  • Thanks you so much ! I would never have found it on my own. Just how to set the normal latex font for words here (no helvetica)? – Ted Jul 01 '21 at 17:40
  • Oh yes to remove just >{\sffamily}. Thanks again a lot ! – Ted Jul 01 '21 at 17:47
  • @Ted, I only try to replicate your second image in question. I'm glad, that you already solved problem with fonts. Happy TeXing :-) – Zarko Jul 01 '21 at 17:54