3

I have the following table that I want to reproduce (minus the header colour):

enter image description here

But instead, this is the result I have so far:

enter image description here

Can anyone help me fix:

1) The mismatch alignment of the table (coloured numbers are on the bottom part of the cell while the rest don't) 2) The mismatch between the vertical lines (the header vertical lines are thinner than the rest of the table, that's why some of them "disappear" on the pdf previewer at normal zoom, and become noticeable just at +200% zoom)

My MWE is the following:

\documentclass[smallcondensed]{svjour3}
\smartqed 
 \usepackage{mathptmx}     
 \usepackage{tabularx}
 \usepackage{caption}

 \usepackage[table, svgnames, dvipsnames]{xcolor}
 \usepackage{makecell}

 \begin{document}

 \begin{table*}
 \begin{tabularx}{\textwidth}{p{7cm}|X|X|X|X|X}
   Landmark&CR&NR&DT&TE&Score \\ \hline
                Church of Our Lady of the Assumption and St Gregory&\color{red}{6}&1&2&1&\color{red}{3}\\ \hline
                Piccadilly Market&\color{red}{6}&1&2&1&\color{red}{3} \\ \hline
                Supreme Court of the United Kingdom&\color{red}{3}&6&8&5&\color{red}{6} \\ \hline
                     \end{tabularx}

 \end{table*}

 \end{document}
  • instead of \color{red}{3} use \textcolor{red}{3} (at all similar cases). – Zarko Sep 9 '18 at 19:19
2

I suggest you use X for the first column and c for the next 5 columns. And, use \textcolor{...}{...} instead of \color{...}{...}.

enter image description here

 \documentclass[smallcondensed]{svjour3}
 \smartqed 
 \usepackage{newtxtext,newtxmath} % {mathptmx} % 'mathptmx' is ancient  
 \usepackage{tabularx,caption,makecell}
 \usepackage[table, svgnames, dvipsnames]{xcolor}

 \begin{document}

 \begin{table}
 \setlength\extrarowheight{2pt} % for a more open "look"
 \begin{tabularx}{\textwidth}{@{} X |c|c|c|c|c @{}}
 Landmark&CR&NR&DT&TE&Score \\ 
 \hline
 Church of Our Lady of the Assumption and St Gregory
   &\textcolor{red}{6}&1&2&1&\textcolor{red}{3}\\ 
 \hline
 Piccadilly Market
   &\textcolor{red}{6}&1&2&1&\textcolor{red}{3} \\ 
 \hline
 Supreme Court of the United Kingdom
   &\textcolor{red}{3}&6&8&5&\textcolor{red}{6} \\ 
 \hline
 \end{tabularx}
 \end{table}
 \end{document}

Actually, if this were my document, I'd simplify the table's look by getting rid of all vertical lines and using fewer, but well-spaced, horizontal lines. I'd also reduce the overall width of the table, by not using a tabularx environment.

enter image description here

 \documentclass[smallcondensed]{svjour3}
 \smartqed 
 \usepackage{newtxtext,newtxmath} % {mathptmx}     
 \usepackage{tabularx,caption,booktabs}
 \usepackage[table, svgnames, dvipsnames]{xcolor}

 \begin{document}

 \begin{table}
 \centering
 \begin{tabular}{@{} l ccccc @{}}
 \toprule
 Landmark&CR&NR&DT&TE&Score \\ 
 \midrule
 Church of Our Lady of the Assumption and St Gregory
   &\textcolor{red}{6}&1&2&1&\textcolor{red}{3}\\ 
 \addlinespace
 Piccadilly Market
   &\textcolor{red}{6}&1&2&1&\textcolor{red}{3} \\ 
 \addlinespace
 Supreme Court of the United Kingdom
   &\textcolor{red}{3}&6&8&5&\textcolor{red}{6} \\ 
 \bottomrule
 \end{tabular}
 \end{table}
 \end{document}
|improve this answer|||||
  • Thank you!! and what would be the solution if I use \cellcolor and \rowcolor @Mico ? – user151562 Sep 9 '18 at 19:49
  • @user151562 - For sure, if you use \cellcolor and \rowcolor, don't use vertical lines, and do get rid of most horizontal lines. E.g., if you use \rowcolor for the header row, you don't need \toprule and \midrule. – Mico Sep 9 '18 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.