1

I am trying to build a table like this one

enter image description here

But so far I only arrive to this

\usepackage{tabularx} \usepackage{multirow} \begin{center} \scalebox{0.93}{\sffamily \begin{tabular}{ |p{1cm}|p{1.cm}|p{1.9cm}|p{10.7cm}|} \hline \rowcolor{gray|30}{\color{white}Grado} & {\color{white}\'Indice} & {\color{white}Pa\'ises} & {\color{white}Descripci\'on}\\ \hline \multirow{2}{*}{A} & \multirow{2}{*}{> 80} & Dinamarca P\'aises Bajos & Un sistema de pensiones robusto y de primera clase que proporciona buenas prestaciones, es sostenible y tiene un elevado nivel de integridad\\ \hline B+ & 75-80 & Australia & \multicolumn{1}{r|}{\multirow{7}{*}{Sistema que tiene una estructura con buenas caracter\'isticas pero tiene \'areas de mejora que lo diferencia de los sistemas con grado A}} \\ \cmidrule{1-3} \multirow{6}{*}{B} & \multirow{6}{*}{65-75} & Suecia & \\ & & Suiza & \\ & & Finlandia & \\ & & Canad\'a & \\ & & Chile & \\ & & Reino Unido & \\ \hline \end{tabular}} \end{center} 

I have problems at the time of combining the rows and at the time of define the width of the longest cell.

Thanks for your support

0

2 Answers 2

3

Your question is not very clear what is your problem. According to image I suggest to make the following small changes:

  • not use scalebox, instead it use tabularx
  • content of multi lines multirow cell enclose in parbox or minipage
  • with vertical lines not use reles provided by package booktabs

Considering above your code can be rewrite into the following MWE:

\documentclass{article} \usepackage[table]{xcolor} \usepackage{multirow,tabularx} \usepackage{showframe} \begin{document} \begin{center} \renewcommand\arraystretch{1.1} \begin{tabularx}{\textwidth}{ |p{1cm}|p{1.cm}|p{2cm}|X|} \hline \rowcolor{gray}\textcolor{white}{Grado} & \textcolor{white}{\'Indice} & \textcolor{white}{Pa\'ises} & \textcolor{white}{Descripci\'on} \\ \hline \multirow{2}{*}{A} & \multirow{2}{*}{> 80} & Dinamarca P\'aises Bajos & Un sistema de pensiones robusto y de primera clase que proporciona buenas prestaciones, es sostenible y tiene un elevado nivel de integridad\\ \hline B+ & 75-80 & Australia & \multirow{7}*{\parbox{\hsize}{ Sistema que tiene una estructura con buenas caracter\'isticas pero tiene \'areas de mejora que lo diferencia de los sistemas con grado A }} \\ \cline{1-3} \multirow{6}{*}{B} & \multirow{6}{*}{65-75} & Suecia & \\ & & Suiza & \\ & & Finlandia & \\ & & Canad\'a & \\ & & Chile & \\ & & Reino Unido & \\ \hline \end{tabularx} \end{center} \end{document} 

which gives:

enter image description here

0

A solution with {NiceTabular} of nicematrix.

\documentclass{article} \usepackage{geometry} \usepackage{nicematrix,tikz} \begin{document} \sffamily \noindent \begin{NiceTabular}{cclX[m,l]}[hvlines,cell-space-limits=2pt] \RowStyle[color=white,fill=gray!95,bold]{} Grade & Index Value & Countries & Description \\ A & $>$80 & \Block{}{Denmark\\ Netherlands} & A first class and robust retirement income system that delivers good benefits, is sustainable and has a high level of integrity. \\ B+ & 75-80 & Australia & \Block{2-1}{A system that has a sound structure, with many good features, but has some areas for improvement that differentiates it from a A-grade system.} \\ B & 65-75 & \Block{}{Sweden\\ Switzerland\\ Finland\\ Canada\\ Chile\\ UK} \\ C+ & 60-65 & \Block{}{Singapore\\ Ireland\\ Germany} & \Block[p,l]{2-1}{A system that has some good features, but also has major risks and/or shortcomings that should be addressed. Without theses improvements its efficacy and/or long-term sustainability can be questioned.} \\ C & 50-60 & \Block{}{France\\ USA\\ Poland\\ South Africa\\ Brazil\\ Austria\\ Mexico\\ Italy} \\ D & 35-50 & \Block{}{Indonesia\\ China\\ Japan\\ Korea (South)\\ India} & A system that has some desirable features, but also has major weakness and/or omissions that need to be addressed. Without these improvements, its efficacy and sustainability are in doubt. \\ E & $<$ & Nil & A poor system that may be in the early stage of developpement or non-existent. \CodeAfter \tikz \draw [white,thick] (1-|2) -- (2-|2) (1-|3) -- (2-|3) (1-|4) -- (2-|4) ; \end{NiceTabular} \end{document} 

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.