![Abordagem 1](https://rvso.com/image/281487/Abordagem%201.png)
Tive problemas ao criar uma tabela em LaTeX conforme anexado na figura abaixo. Por favor, me ajude.
Estou tentando assim:
\begin{document}
\begin{tabular}{|p{1cm}|p{1cm}|p{5cm}|}
\hline
\multicolumn{2}{l|}{Input Values} & \multicolumn{1}{l|}{Output Values} \\
\hline
1&2&The values \\
\hline
3&5&\begin{tabular}{|c|c|c|c|c|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
1 & 2 & & & \\
\hline
& & & & \\
& & & & \\
& & & & \\
& & & & \\
& & & & \\
& & & & \\
\hline
\end{tabular}
\end{tabular}
\end{document}
Mas não vindo.
Eu sou novo no látex, então por favor me ajude.
Responder1
Abordagem 1
Sua tabela com p{...}
colunas de largura fixa.
\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|}
\hline
\multicolumn{2}{|c|}{Date with place} & \multicolumn{2}{c|}{Output Values} \\
\hline
21/01 & x & \multicolumn{2}{c|}{The data for different day} \\
\hline
22/01 & y & sunday & 233 \\
\hline
23/01 & z & Mon & 233 \\
\hline
24/01 & p & tues & 134 \\
\hline
25/01 & q & wed & 76 \\
\hline
26/01 & r & thurs & 35 \\
\hline
27/01 & s & fi & 87 \\
\hline
28/01 & t & sat & 7 \\
\hline
\end{tabular}
\end{document}
Abordagem 2
Usando booktabs
sem a "grade sudoku" e p{...}
colunas de largura fixa.
\documentclass{article}
\pagestyle{empty}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{p{3cm}p{3cm}p{3cm}p{3cm}}
\toprule
\multicolumn{2}{c}{Date with place} & \multicolumn{2}{c}{Output Values} \\
\midrule
21/01 & x & \multicolumn{2}{c}{The data for different day} \\
\cmidrule{3-4}
22/01 & y & sunday & 233 \\
23/01 & z & Mon & 233 \\
24/01 & p & tues & 134 \\
25/01 & q & wed & 76 \\
26/01 & r & thurs & 35 \\
27/01 & s & fi & 87 \\
28/01 & t & sat & 7 \\
\bottomrule
\end{tabular}
\end{document}
Abordagem 3
Usando booktabs
colunas escaláveis como em l
.
\documentclass{article}
\pagestyle{empty}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{llll}
\toprule
\multicolumn{2}{c}{Date with place} & \multicolumn{2}{c}{Output Values} \\
\midrule
21/01 & x & \multicolumn{2}{c}{The data for different day} \\
\cmidrule{3-4}
22/01 & y & sunday & 233 \\
23/01 & z & Mon & 233 \\
24/01 & p & tues & 134 \\
25/01 & q & wed & 76 \\
26/01 & r & thurs & 35 \\
27/01 & s & fi & 87 \\
28/01 & t & sat & 7 \\
\bottomrule
\end{tabular}
\end{document}
Abordagem 4
Começomesas, uma mesa dentro de uma mesa!
\documentclass{article}
\pagestyle{empty}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{cc}
\toprule
Date with place & Output Values \\
\midrule
\begin{tabular}{ll}
21/01 & x \\
22/01 & y \\
23/01 & z \\
24/01 & p \\
25/01 & q \\
26/01 & r \\
27/01 & s \\
28/01 & t \\
\end{tabular}
&
\begin{tabular}{ll}
\multicolumn{2}{c}{The data for different day} \\
\midrule
sunday & 233 \\
Mon & 233 \\
tues & 134 \\
wed & 76 \\
thurs & 35 \\
fi & 87 \\
sat & 7 \\
\end{tabular}
\\
\bottomrule
\end{tabular}
\end{document}