4  Construction of tables Latex Multicolumn/Color.               I initiate

The type of exit it is necessary to define it like: or.

EXAMPLE 1: EXAMPLE 2:

EXAMPLE 3: EXAMPLE 4:

EXAMPLE 5: EXAMPLE 6:

 


 

Code example 1.-

The result of exporting this table:
\begin{center}\begin{tabular}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|cccc|}
 X/Y &  \multicolumn{4}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Población } \\ 
 \rowcolor[rgb]{0.8,0.8,0.8}  Edad &  Sevilla &  Córdoba &  Madrid & Teruel \\ 
\hline 
 20 &  23 &  34 &  56 & 87 \\ 
 25 &  22 &  56 &  76 & 23 \\ 
\hline 
\end{tabular}\end{center}

The following code also gave the same result on having imported this table:

\begin{center}\begin{tabular}{>{\columncolor[gray]{.8}}c|cccc|}
 X/Y &  \multicolumn{4}{>{\columncolor[gray]{.8}}c|}{Población } \\
 \rowcolor[gray]{.8}  Edad &  Sevilla &  Córdoba &  Madrid & Teruel \\
\hline
 20 &  23 &  34 &  56 & 87 \\
 25 &  22 &  56 &  76 & 23 \\
\hline
\end{tabular}\end{center}

Code example 2.-

The result of exporting this table:

\begin{center}\begin{tabular}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|cccc|}
 X/Y &  \multicolumn{4}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Población } \\ 
 \rowcolor[rgb]{0.8,0.8,0.8}  Edad &  Sevilla &  Córdoba &  Madrid & Teruel \\ 
\hline 
 20 &  23 &  34 &  56 & 87 \\ 
 25 &  22 &  56 &  \multicolumn{1}{>{\columncolor{blue}}c}{76} & 23 \\ 
\hline 
\end{tabular}\end{center}

The following code also gave the same result on having imported this table:

 \begin{center}\begin{tabular}{c|cccc|}
 \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{X/Y} &  \multicolumn{4}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Población } \\ 
 \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Edad} &  \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Sevilla} &  \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Córdoba} &  \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Madrid} &  \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Teruel} \\ 
 \hline 
 \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{20} &  23 &  34 &  56 & 87 \\ 
 \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{25} &  22 &  56 &  \multicolumn{1}{>{\columncolor{blue}}c}{76} & 23 \\ 
 \hline 
 \end{tabular}\end{center}
 

Code example 3.-

 \begin{center}\begin{tabular}{c|cccc|}
 X/Y &  \multicolumn{4}{c|}{Población } \\ 
 Edad &  Sevilla &  Córdoba &  Madrid & Teruel \\ 
 \hline 
 20 &  \multicolumn{1}{l}{23} &  34 &  \multicolumn{1}{l}{56} & 87 \\ 
 \cline{2-2} \cline{4-4} 
 25 &  22 &  56 &  76 & 23 \\ 
 \hline 
 \end{tabular}\end{center} 

 

Code example 4.-

\begin{center}\begin{tabular}{|l|p{10cm}||}
\hline
 \rowcolor[rgb]{0.8,0.8,0.8}  \multicolumn{1}{|>{\columncolor[rgb]{0.8,0.8,0.8}}c|}{Códigos} &  \multicolumn{1}{>{\columncolor[rgb]{0.8,0.8,0.8}}p{10cm}|}{\centering Significado} \\ 
\hline 
 \verb<#c|,[gray]{.8}: &  & #< & Crea \verb!\multicolumn{c|}{3}{Texto entre esas columnas}! y esas  celdas las colorea con \verb![gray]{.8}! \\ 
\hline 
 \verb!#c|: & & #! &  \multicolumn{1}{l|}{Ídem, sin colorear} \\ 
\hline 
 \verb!#c,{blue}; texto &  & ! & Crea \verb!\multicolumn{c}{1}{texto}! y esa  celda la colorea con \verb!{blue}! \\ 
\hline 
 \verb!#c; texto & & ! &  \multicolumn{1}{l|}{Ídem, sin colorear} \\ 
\hline 
 \verb!#<#> & ! & Añade: \verb!\cline{c-c}! donde c es la columna donde se  encuentran esos códigos. Se pueden repetir en una misma fila. \\ 
\hline 
 \verb!#< &  & #>! & Añade: \verb!\cline{ci-cf}! donde ci es la columna donde se  encuentra \verb!#!.  Se pueden repetir en una misma fila. \\ 
\hline 
\end{tabular}\end{center}

 

Usable codes (compatibility with previous versions).

Examples of codes that can be used:

Codes Meaning
#c|,[gray]{.8}: & & # It(He,She) creates \multicolumn {c |} {3} {Text between(among) these columns} and these cells the colorea with [gray] {.8}
#c|: & & # Ditto, without colorear
#c,{blue}; texto & & The colorea creates \multicolumn {c} {1} {text} and this cell with {blue}
#c; texto & & Ditto, without colorear
#<#> & It(He,She) adds: \cline {c-c} where c is the column where they find these codes. They can repeat in the same row.
#< & & #> It(He,She) adds: \cline {ci-cf} where ci is the column where he(she) is #<and cf is the column where he(she) is *>. They can repeat in the same row.

Code example 5.-

\begin{center}\begin{tabular}{|lp{0.75cm}p{0.66cm}p{0.78cm}p{1.16cm}||}
 \cline{1-1} \cline{2-2} \cline{3-3} \cline{4-4}
 \multicolumn{4}{|c}{hola que tal estas } &  \multicolumn{1}{c|}{} \\ 
\hline 
 \multicolumn{1}{|c}{1} &  \multicolumn{1}{c}{a} &  \multicolumn{1}{c}{b} &  \multicolumn{1}{c|}{c} &  \multicolumn{1}{c|}{d} \\ 
 \multicolumn{1}{|c|}{2} &  \multicolumn{1}{c}{e} &  \multicolumn{1}{>{\columncolor{red}}p{0.66cm}}{\centering f} &  \multicolumn{1}{l}{g} &  \multicolumn{1}{c|}{h} \\ 
 \multicolumn{1}{|c}{3} &  \multicolumn{1}{c}{i} &  \multicolumn{1}{c|}{j} &  \multicolumn{2}{l|}{otra prueba } \\ 
\hline 
 \multicolumn{1}{|c}{4} &  \multicolumn{1}{c}{k} &  \multicolumn{1}{c}{l} &  \multicolumn{1}{c|}{m} &  \multicolumn{1}{c|}{n} \\ 
\hline 
\end{tabular}\end{center}    
     

After the file compiles Latex, ver.tex partner, YaP shows the following result:

Code example 6.-

\begin{center}\begin{tabular}{c|cp{0.97cm}p{0.97cm}p{0.97cm}p{0.88cm}p{0.97cm}}
 \multicolumn{2}{c|}{TIPOS DE VARIABLES } &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}p{0.97cm}|}{\centering (1)} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}p{0.97cm}|}{\centering (2)} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}p{0.97cm}|}{\centering (3)} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}p{0.88cm}|}{\centering (4)} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}p{0.97cm}|}{\centering (5)} \\ 
\hline 
 \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{NOMINAL} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{(1)} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 1.1} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 1.2} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 1.3} &  \multicolumn{1}{p{0.88cm}|}{\centering caso 1.4} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 1.5} \\ 
 \cline{4-4} \cline{5-5} \cline{6-6} \cline{7-7} 
 \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}l|}{} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{(2)} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 2.2} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 2.3} &  \multicolumn{1}{p{0.88cm}|}{\centering caso 2.4} &  \multicolumn{1}{p{0.97cm}|}{\centering caso  2.5} \\ 
 \cline{1-1} \cline{5-5} \cline{6-6} \cline{7-7} 
 \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{ORDINAL DISCRETA} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{(3)} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 3.3} &  \multicolumn{1}{p{0.88cm}|}{\centering caso 3.4} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 3.5} \\ 
 \cline{6-6} \cline{7-7} 
 \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}l|}{} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{(4)} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{p{0.88cm}|}{\centering caso 4.4} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 4.5} \\ 
 \cline{1-1} \cline{7-7} 
 \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{INTERVALO O RAZÓN} &  \multicolumn{1}{>{\columncolor[rgb]{0.82,0.82,0.82}}c|}{(5)} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.97cm}}{\centering} &  \multicolumn{1}{>{\columncolor[rgb]{0.85,0.85,0.85}}p{0.88cm}}{\centering} &  \multicolumn{1}{p{0.97cm}|}{\centering caso 5.5} \\ 
\hline 
\end{tabular}\end{center}