Ideas for a better style for this table?
IMNSHO, the table would look better if (a) the data columns all had the same width and (b) were spaced a bit more closely. This may be achieved by, e.g., switching from the c
to the w
column type type and by reducing the value of tabcolsep
, which is the parameter that governs the amount of whitespace padding inserted on either side of each column.
That said, I would definitely also get rid of virtually all \multicolumn{1}{...}{...}
wrappers. The wrappers make the code rather tedious to read, and they also make it more difficult to apply any changes or tweaks.
\documentclass{article}
\usepackage{array} % for 'w' column type
\usepackage{rotating,multirow}
\newcommand\ts{$\times$} % handy shortcut macro
\begin{document}
\begin{table}
\setlength\tabcolsep{4pt} % default: 6pt
\setlength\extrarowheight{1.5pt} % for a more open "look"
\centering
\caption{Divalent and trivalent metallic cations associations in
anionic clays ($^{\star}$monovalent, $^{\star\star}$tetravalent)}
\label{tab:association}
\begin{tabular}{ *{2}{l|} *{9}{w{c}{4mm}|} }
\multicolumn{2}{l}{} & \multicolumn{9}{c}{\textbf{Divalent cations}} \\
\cline{3-11}
\multicolumn{2}{l|}{} & Mg & Mn & Fe & Co & Ni & Cu & Zn & Ca & Li$^{\star}$ \\
\cline{2-11}
\multirow{8.5}{*}{\begin{sideways}\textbf{Trivalent cations}\end{sideways}}
& Al & \ts & & \ts & \ts & \ts & \ts & \ts & \ts & \ts \\
\cline{2-11}
& Cr & & & & & \ts & \ts & \ts & & \\
\cline{2-11}
& Mn & & \ts & & & & & & & \\
\cline{2-11}
& Fe & \ts & & \ts & \ts & & & & & \\
\cline{2-11}
& Co & & & & \ts & \ts & & & & \\
\cline{2-11}
& Ni & & & & & \ts & & & & \\
\cline{2-11}
& La & & & & & \ts & & & & \\
\cline{2-11}
& Ti$^{\star\star}$ & & & & \ts & & & & & \\
\cline{2-11}
\end{tabular}
\end{table}
\end{document}
Addendum: To further "spruce up" the appearance of the table and its associated caption, one could load the threeparttable
package and enclose the \caption
statement and the tabular
environment in a threeparttable
environment. That way, the width of the caption will be set to the width of the tabular
environment. This addition, along with the dropping the bolding of the row and column headers and a further decrease in the value of \tabcolsep
(from 4pt to 3pt), would result in the following:
\documentclass{article}
\usepackage{array} % for 'w' column type
\usepackage{rotating,multirow}
\usepackage{threeparttable} % for 'threeparttable' env.
\newcommand\ts{$\times$} % handy shortcut macro
\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\setlength\tabcolsep{3pt} % default: 6pt
\setlength\extrarowheight{2pt} % for a more open "look"
\caption{Divalent and trivalent metallic cation associations in
anionic clays ($^{\star}$mono\-valent, $^{\star\star}$tetravalent)}
\label{tab:association}
\begin{tabular}{ *{2}{l|} *{9}{w{c}{4mm}|} }
\multicolumn{2}{l}{} & \multicolumn{9}{c}{Divalent cations} \\
\cline{3-11}
\multicolumn{2}{l|}{} & Mg & Mn & Fe & Co & Ni & Cu & Zn & Ca & Li$^{\star}$ \\
\cline{2-11}
\multirow{8.5}{*}{\begin{sideways} Trivalent cations \end{sideways}\,}
& Al & \ts & & \ts & \ts & \ts & \ts & \ts & \ts & \ts \\
\cline{2-11}
& Cr & & & & & \ts & \ts & \ts & & \\
\cline{2-11}
& Mn & & \ts & & & & & & & \\
\cline{2-11}
& Fe & \ts & & \ts & \ts & & & & & \\
\cline{2-11}
& Co & & & & \ts & \ts & & & & \\
\cline{2-11}
& Ni & & & & & \ts & & & & \\
\cline{2-11}
& La & & & & & \ts & & & & \\
\cline{2-11}
& Ti$^{\star\star}$ & & & & \ts & & & & & \\
\cline{2-11}
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}
So, I took the answer by @leandriis as a foundation.
Used booktabs, removed most of the lines. I kept both lines at the first line and column to underline that first column is similar to the first line. You might try to remove them. Also, a different symbol, hence amssymb
include.
\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{chemmacros}
\usepackage{caption}
\usepackage{amssymb}
\usepackage[column=0]{cellspace}
\begin{document}
\begin{table}
\centering
\caption{Mono- to tetravalent metallic cations associations in anionic clays }
\label{tab:association}
\begin{tabular}{c|*{10}{0c}}
\toprule
\multicolumn{1}{c|}{}
& \ch{Mg^{2+}} & \ch{Mn^{2+}}& \ch{Fe^{2+}} & \ch{Co^{2+}} & \ch{Ni^{2+}} & \ch{Cu^{2+}} & \ch{Zn^{2+}} & \ch{Ca^{2+}} & \ch{Li^{+}} \\
\midrule
\ch{Al^{3+}} & \checkmark & & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
\ch{Cr^{3+}} & & & & & \checkmark & \checkmark & \checkmark & & \\
\ch{Mn^{3+}} & & \checkmark & & & & & & & \\
\ch{Fe^{3+}} & \checkmark & & \checkmark & \checkmark & & & & & \\
\ch{Co^{3+}} & & & & \checkmark & \checkmark & & & & \\
\ch{Ni^{3+}} & & & & & \checkmark & & & & \\
\ch{La^{3+}} & & & & & \checkmark & & & & \\
\ch{Ti^{4+}} & & & & \checkmark & & & & & \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Here is another suggestion:
\documentclass{article}
\usepackage{array,rotating,multirow, booktabs}
\usepackage[table, svgnames]{xcolor}
\usepackage{bbding}
\newcommand\xs{\cellcolor{Gainsboro!50!Lavender}\XSolid}
\newcommand{\mc}[1]{\multicolumn{1}{c}{\bfseries#1}}
\begin{document}
\begin{table}
\setlength\tabcolsep{4pt}
\setlength\extrarowheight{6pt}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\centering
\caption{Divalent and trivalent metallic cations associations
in anionic clays ($^{\star}$monovalent, $^{\star\star}$tetravalent)}
\label{tab:association}
\begin{tabular}{ *{2}{ >{\bfseries}l}!{\vrule width 1.2pt}w{c}{5mm} *{8}{|w{c}{5mm}}!{\vrule width 1.2pt}}
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} &
\multicolumn{9}{c}{\textbf{Divalent cations}} \\
\multicolumn{2}{c}{} & \mc{Mg} & \mc{Mn} & \mc{Fe} & \mc{Co} & \mc{Ni} & \mc{Cu} & \mc{Zn} & \mc{Ca} & \mc{Li$^{\star}$} \\[1ex]
\cmidrule[1.2pt](l{-1.2pt}){3-11}
\multirow{8.5}{*}{\begin{sideways}\textbf{Trivalent cations}\end{sideways}\enspace}
& Al & \xs & & \xs & \xs & \xs & \xs & \xs & \xs & \xs \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Cr & & & & & \xs & \xs & \xs & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Mn & & \xs & & & & & & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Fe & \xs & & \xs & \xs & & & & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Co & & & & \xs & \xs & & & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Ni & & & & & \xs & & & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& La & & & & & \xs & & & & \\
\cmidrule[0.4pt](l{-1.2pt}){3-11}
& Ti$^{\star\star}$ & & & & \xs & & & & & \\[-1.2pt]
\cmidrule[1.2pt](l{-1.2pt}){3-11}
\end{tabular}
\end{table}
\end{document}