4

I am trying to make the following table with the table and tabularx packages, but the vertical lines of the last three columns are not appearing. Can you, please, point me in the right direction?

\documentclass[a4paper]{article}
\usepackage{array, hhline}
\usepackage[showframe]{geometry}
\usepackage{tabularx}

\begin{document}
    \begin{table*}
    \small
    \makebox[3 \textwidth][l]{       %centering table
    \resizebox{0.8 \textwidth}{!}{   %resize table

    \begin{tabularx}{\textwidth}{|c|c|c|c||c|c|c|c||c|c|c|c||c|c|c|c|} 
    \hline
    \multicolumn{4}{|c||}{\textbf{a}} & \multicolumn{4}{|c||}{\textbf{b}} 
    & 
    \multicolumn{4}{|c||}{\textbf{c}} & \multicolumn{4}{|c|}{
    \textbf{d}} \\
    \hline
    aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd\\ 
    \hline\hline
    0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 & 0.536 & 0.
    600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500\\ 
    \hline
    0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 & 0.600 & 0.
    570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500\\ 
    \hline
    0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 & 0.578 & 0.447 
    & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426\\ 
    \hline
    0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 & 0.626 & 0.588
    & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452\\ 
    \hline
    0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 & 0.673 & 0.563 
    & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500\\ 
    \hline
    0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 & 0.537 & 0.434
    & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500\\ 
    \hline
    0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 & 0.697 & 0.523 
    & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486\\ 
    \hline
    \end{tabularx}
    }   %centering table
    }   %resize table

    \caption{Caption}
    \end{table*}
\end{document}

enter image description here Thanks

  • 1
    (i) in tabularx at least one column should be of type X. (ii) your table is to huge that can be fit in text width. (iii) horizontal lines are draw only to right text border. is possible to make column headers narrowed? – Zarko Dec 23 '17 at 22:33
  • Also you shouldn't use \resizebox as it leads to inconsistent font sizes. And I suppose you mean Horizontal lines in your title? – Bernard Dec 23 '17 at 22:47
5

As others have already pointed out, it's simply incorrect to use a tabularx environment without employing at least one column of type X. A separate issue: Since your table has 16 [!] columns, you should give serious thought to displaying the material in landscape format.

The first table in the following screenshot implements fixes to these two concerns.

In addition, you should also be concerned with making the table more readable. Specifically, all these vertical and horizontal lines do nothing to enhance the material's legibility. In fact, one could argue that they reduce legibility. The second table in the following screenshot (hopefully) demonstrates that by using no vertical lines at all and by using fewer, but well-spaced horizontal lines, the table gets a much more "open" look which encourages readers to actually spend some time perusing the tabular material.

enter image description here

\documentclass{article}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{booktabs} % for well-spaced horizontal rules
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters suitably
\begin{document}

\begin{sidewaystable}
\setlength\tabcolsep{3pt} % default value: 6pt

\begin{tabularx}{\textwidth}{| *{3}{*{4}{C|}|} *{4}{C|} } 
\hline
\multicolumn{4}{|c||}{\textbf{a}} & 
\multicolumn{4}{ c||}{\textbf{b}} & 
\multicolumn{4}{ c||}{\textbf{c}} & 
\multicolumn{4}{ c| }{\textbf{d}} \\
\hline
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd \\ 
\hline\hline
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 & 
0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500\\ 
\hline
0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 & 
0.600 & 0.570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500\\ 
\hline
0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 & 
0.578 & 0.447 & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426\\ 
\hline
0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 & 
0.626 & 0.588 & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452\\ 
\hline
0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 & 
0.673 & 0.563 & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500\\ 
\hline
0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 & 
0.537 & 0.434 & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500\\ 
\hline
0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 & 
0.697 & 0.523 & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486\\ 
\hline
\end{tabularx}
\caption{Version with lots of vertical and horizontal lines}

\vspace{1cm}

\begin{tabularx}{\textwidth}{@{} c *{14}{C} c @{}} 
\toprule
\multicolumn{4}{@{}c}{\textbf{a}} & 
\multicolumn{4}{   c}{\textbf{b}} & 
\multicolumn{4}{   c}{\textbf{c}} & 
\multicolumn{4}{c@{}}{\textbf{d}} \\
\cmidrule(r){1-4}   \cmidrule(lr){5-8}
\cmidrule(lr){9-12} \cmidrule(l){13-16}
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd & 
aaaaaa & bbbbbb & cccccc & dddddd \\ 
\midrule
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 & 
0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500\\ 
0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 & 
0.600 & 0.570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500\\ 
0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 & 
0.578 & 0.447 & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426\\ 
0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 & 
0.626 & 0.588 & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452\\
0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 & 
0.673 & 0.563 & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500\\ 
0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 & 
0.537 & 0.434 & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500\\ 
0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 & 
0.697 & 0.523 & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486\\ 
\bottomrule
\end{tabularx}
\caption{Version with no vertical rules and with fewer but well-spaced horizontal rules}
\end{sidewaystable}
\end{document}
  • Thank's. You are right, the second option is far more readable. – Mark Dec 24 '17 at 13:50
6

see if the following table is acceptable to you:

enter image description here

that i can fit it onto text width, i reduce column hearer font to \tiny (in with this make it almost unreadable). so see, if you can broke them in two lines and with this make more narrow.

also i suggest to omit vertical lines and for horizontal use ruels from \booktabs package:

\documentclass[twocolumn]{article}
\usepackage{booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand\mcx[1]{\multicolumn{1}{C}{\tiny #1}}    

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{table*}
\setlength\tabcolsep{2pt}
\small
\begin{tabularx}{\textwidth}{*{16}{C}}
    \toprule
\multicolumn{4}{c}{\textbf{a}}  &
\multicolumn{4}{c}{\textbf{b}}  &
\multicolumn{4}{c}{\textbf{c}}  &
\multicolumn{4}{c}{\textbf{d}} \\
    \cmidrule(lr){ 1-4}
    \cmidrule(lr){ 5-8}
    \cmidrule(lr){ 9-12}
    \cmidrule(lr){13-16}
\mcx{aaaaaaa} & \mcx{bbbbbbb} & \mcx{ccccccc} & \mcx{ddddddd} &
\mcx{aaaaaaa} & \mcx{bbbbbbb} & \mcx{ccccccc} & \mcx{ddddddd} &
\mcx{aaaaaaa} & \mcx{bbbbbbb} & \mcx{ccccccc} & \mcx{ddddddd} &
\mcx{aaaaaaa} & \mcx{bbbbbbb} & \mcx{ccccccc} & \mcx{ddddddd}       \\
    \midrule
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 &
0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500       \\

0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 &
0.600 & 0.570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500       \\
    \addlinespace
0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 &
0.578 & 0.447 & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426       \\

0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 &
0.626 & 0.588 & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452       \\
    \addlinespace
0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 &
0.673 & 0.563 & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500       \\

0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 &
0.537 & 0.434 & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500       \\
    \addlinespace
0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 &
0.697 & 0.523 & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486       \\
    \bottomrule
\end{tabularx}
\caption{Caption}
    \end{table*}
\end{document}

edit: example, when you can set column headers in two lines:

\documentclass[twocolumn]{article}
\usepackage{booktabs, makecell, tabularx} % <--- added makecell
\renewcommand\theadfont{\footnotesize}
\renewcommand{\theadgape}{}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand\mcx[1]{\multicolumn{1}{C}{\thead{#1}}}
\usepackage{siunitx}                     % <--- added

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{table*}
\setlength\tabcolsep{2pt}
\small
\begin{tabularx}{\textwidth}{*{16}{S[table-format=1.3]}}
    \toprule
\multicolumn{4}{c}{\textbf{a}}  &
\multicolumn{4}{c}{\textbf{b}}  &
\multicolumn{4}{c}{\textbf{c}}  &
\multicolumn{4}{c}{\textbf{d}} \\
    \cmidrule(lr){ 1-4}
    \cmidrule(lr){ 5-8}
    \cmidrule(lr){ 9-12}
    \cmidrule(lr){13-16}
\mcx{aaaa\\ aaa}    & \mcx{bbbb\\ bbb}  & \mcx{cccc\\ ccc}  & \mcx{dddd\\ ddd}  &
\mcx{aaaa\\ aaa}    & \mcx{bbbb\\ bbb}  & \mcx{cccc\\ ccc}  & \mcx{dddd\\ ddd}  &
\mcx{aaaa\\ aaa}    & \mcx{bbbb\\ bbb}  & \mcx{cccc\\ ccc}  & \mcx{dddd\\ ddd}  &
\mcx{aaaa\\ aaa}    & \mcx{bbbb\\ bbb}  & \mcx{cccc\\ ccc}  & \mcx{dddd\\ ddd}  \\
     \midrule
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 &
0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500       \\
...

gives:

enter image description here

5

Having a tabularx without X columns doesn't actually make sense at all. The way a tabularx adjusts its width is to make the width of the X-columns to fit the available space. With no X columns tabularx can't do any adjustments for the width.

Another thing that doesn't really make sense, is that you're trying to scale the table to 80% of the text width with \resizebox, at the same time as you're using that \makebox.

What you could do is to replace \begin{tabularx}{\textwidth} with \begin{tabular}, remove the \makebox, and change the \resizebox width to \textwidth. If you in addition reduce the column spacing a bit by setting the \tabcolsep length, you get this output (for A4 paper with 2cm margins):

output of code

So this works, though I can't say I think it looks good. Less rules would be better. And using \resizebox should really be the very last resort for making a table fit. You could consider rotating it.

\documentclass[a4paper]{article}
\usepackage{tabularx,graphicx}
\usepackage{geometry}
\geometry{margin=2cm}
\begin{document}

\begin{table*}
\small
\setlength\tabcolsep{2pt} % reduce space between columns
\resizebox{\textwidth}{!}{   %resize table

\begin{tabular}{|c|c|c|c||c|c|c|c||c|c|c|c||c|c|c|c|} 
\hline
\multicolumn{4}{|c||}{\textbf{a}} & \multicolumn{4}{|c||}{\textbf{b}} 
& 
\multicolumn{4}{|c||}{\textbf{c}} & \multicolumn{4}{|c|}{
\textbf{d}} \\
\hline
aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd\\ 
\hline\hline
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 & 0.536 & 0.
600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500\\ 
\hline
0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 & 0.600 & 0.
570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500\\ 
\hline
0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 & 0.578 & 0.447 
& 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426\\ 
\hline
0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 & 0.626 & 0.588
& 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452\\ 
\hline
0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 & 0.673 & 0.563 
& 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500\\ 
\hline
0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 & 0.537 & 0.434
& 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500\\ 
\hline
0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 & 0.697 & 0.523 
& 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486\\ 
\hline
\end{tabular}
}   %resize table

\caption{Caption}
\end{table*}
\end{document}

Rotate

Here is one possible way of rotating the table. You haven't given any information about your layout, the twocolumn guess is only based on your use of table*, so could well be wrong.

output of cod

\documentclass[a4paper,twocolumn]{article}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{margin=2cm}
\usepackage{siunitx}

\usepackage{lipsum}

\begin{document}
\lipsum[1-10]
\begin{table}
\centering
\setlength\tabcolsep{3pt} % reduce space between columns
\rotatebox{90}{%
\begin{minipage}{\textheight}
\centering
\begin{tabular}{*{16}{S[table-format=1.3]}} 
\toprule
\multicolumn{4}{c}{\textbf{a}} & \multicolumn{4}{c}{\textbf{b}} 
& 
\multicolumn{4}{c}{\textbf{c}} & \multicolumn{4}{c}{
\textbf{d}} \\
\cmidrule(r){1-4} \cmidrule(lr){5-8} \cmidrule(lr){9-12} \cmidrule(l){13-16}
 {{aaaaaaa}} & {{bbbbbbb}} & {ccccccc} & {ddddddd} & {aaaaaaa} & {bbbbbbb} & {ccccccc} & {ddddddd} & {aaaaaaa} & {bbbbbbb} & {ccccccc} & {ddddddd} & {aaaaaaa} & {bbbbbbb} & {ccccccc} & {ddddddd}\\ \midrule

0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679 & 0.536 & 0.
600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500\\ 

0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 & 0.600 & 0.
570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500\\ 

0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 & 0.578 & 0.447 
& 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426\\ 

0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745 & 0.626 & 0.588
& 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452\\ 

0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 & 0.673 & 0.563 
& 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500\\ 

0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 & 0.537 & 0.434
& 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500\\ 

0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 & 0.697 & 0.523 
& 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486\\ 
 \bottomrule
\end{tabular}
\caption{Caption}
\end{minipage}
}
\end{table}
\lipsum[1-10]
\end{document}
4

Depending on the documentclass you use (margins), the amount of data you want to show in the table (I assumed that there are not more than 7 rows of numbers) and the lengths of 'a' and 'aaaaaaa' maybe transposing (changing rows and columns) of the table could be an idea to fit the table into the textwidth. The below MWE shows such an approach with the additional use of booktabs for horizontal rules, and the siunitx package to align numbers in table cells with respect to the decimal separator. The vertical lines in the output image indicate the textwidth and are set by the package showframe.

\documentclass{scrreprt}
\usepackage{showframe}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{ll*7S[table-format=1.3]}
    \toprule
    \multirow{4}[0]{*}{a} & aaaaaaa   & 0.495 & 0.645 & 0.549 & 0.515 & 0.760 & 0.604 & 0.524 \\
          & bbbbbbb  &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{b} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{c} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{d} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \bottomrule
    \end{tabular}%
\end{table}%

\documentclass{scrreprt}
\usepackage{showframe}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{ll*7S[table-format=1.3]}
    \toprule
    \multirow{4}[0]{*}{a} & aaaaaaa   & 0.495 & 0.645 & 0.549 & 0.515 & 0.760 & 0.604 & 0.524 \\
          & bbbbbbb  &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{b} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{c} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \midrule
    \multirow{4}[0]{*}{d} & aaaaaaa   &       &       &       &       &       &       &  \\
          & bbbbbbb   &       &       &       &       &       &       &  \\
          & ccccccc   &       &       &       &       &       &       &  \\
          & ddddddd   &       &       &       &       &       &       &  \\
    \bottomrule
    \end{tabular}%
\end{table}%

enter image description here

4

I'd suggest still two other layout, which allows for normal size font. They use hhline and a plain tabular. The second has some colour for the table heads:

\documentclass[a4paper]{article}
\usepackage{array, hhline}
\usepackage[showframe]{geometry}

\begin{document}

\begin{table*}
\centering
\setlength{\doublerulesep}{4pt}
\setlength{\extrarowheight}{2pt}
\begin{tabular}{|c|c|c|c||c|c|c|c|}
\hhline{----||----}
\multicolumn{4}{|c||}{\textbf{a}} & \multicolumn{4}{c|}{\textbf{b}} \\
\hhline{----||----}
aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd\\
\hhline{====::====}
0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679\\
\hhline{----||----}
0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 \\
\hhline{----||----}
0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 \\
\hhline{----||----}
0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745\\
\hhline{----||----}
0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 \\
\hhline{----||----}
0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 \\
\hhline{----||----}
0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 \\
\hhline{----||----}
\noalign{\vspace{3ex}}
\hhline{----||----}
\multicolumn{4}{|c||}{\textbf{c}} & \multicolumn{4}{c|}{\textbf{d}}\\
\hhline{----||----}
 aaaaaaa & bbbbbbb & ccccccc & ddddddd & aaaaaaa & bbbbbbb & ccccccc & ddddddd \\
\hhline{====::====}
0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500 \\
\hhline{----||----}
0.600 & 0.570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500 \\
\hhline{----||----}
 0.578 & 0.447 & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426 \\
\hhline{----||----}
 0.626 & 0.588 & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452 \\
\hhline{----||----}
 0.673 & 0.563 & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500 \\
\hhline{----||----}
 0.537 & 0.434 & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500 \\
\hhline{----||----}
  0.697 & 0.523 & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486 \\
\hhline{----||----}
\hline
\end{tabular}
\caption{Caption}
\end{table*}

\end{document} 

enter image description here

    \documentclass[a4paper]{article}
    \usepackage{array, booktabs, hhline}
    \usepackage[svgnames, table]{xcolor}
    \usepackage[showframe]{geometry}

    \begin{document}

    \begin{table*}
    \centering
    \setlength{\aboverulesep}{0pt}
    \setlength{\belowrulesep}{0pt}
    \setlength{\extrarowheight}{2pt}
    \begin{tabular}{|c|c|c|c||c|c|c|c|}
    \multicolumn{4}{c}{\textbf{a}} & \multicolumn{4}{c}{\textbf{b}} \\
    \arrayrulecolor{Gainsboro!70! Lavender}
    \rowcolor{Gainsboro!70! Lavender} \multicolumn{1}{c}{aaaaaaa} & \multicolumn{1}{c}{bbbbbbb} & \multicolumn{1}{c}{ccccccc} & \multicolumn{1}{c!{\hspace{2.4pt}}}{ddddddd} & \multicolumn{1}{!{\hspace{-0.4pt}}c}{aaaaaaa} & \multicolumn{1}{c}{bbbbbbb} & \multicolumn{1}{c}{ccccccc} & \multicolumn{1}{c}{ddddddd}\\
\addlinespace[0.5ex]
\hhline{>{\arrayrulecolor{black}}----||----}
    0.495 & 0.509 & 0.581 & 0.500 & 0.445 & 0.545 & 0.449 & 0.679\\
    \hhline{----||----}
    0.645 & 0.633 & 0.616 & 0.500 & 0.462 & 0.861 & 0.650 & 0.519 \\
    \hhline{----||----}
    0.549 & 0.489 & 0.500 & 0.500 & 0.572 & 0.510 & 0.457 & 0.467 \\
    \hhline{----||----}
    0.515 & 0.520 & 0.469 & 0.500 & 0.532 & 0.497 & 0.538 & 0.745\\
    \hhline{----||----}
    0.760 & 0.471 & 0.500 & 0.500 & 0.749 & 0.542 & 0.574 & 0.379 \\
    \hhline{----||----}
    0.604 & 0.527 & 0.430 & 0.500 & 0.469 & 0.498 & 0.547 & 0.400 \\
    \hhline{----||----}
    0.524 & 0.479 & 0.500 & 0.500 & 0.715 & 0.528 & 0.658 & 0.585 \\
    \hhline{----||----}
    \noalign{\vspace{3ex}}
    \multicolumn{4}{c}{\textbf{c}} & \multicolumn{4}{c}{\textbf{d}}\\
    \arrayrulecolor{Gainsboro!70! Lavender}
    \hhline{----||----}
\rowcolor{Gainsboro!70! Lavender} \multicolumn{1}{c}{aaaaaaa} & \multicolumn{1} {c}{bbbbbbb} & \multicolumn{1}{c}{ccccccc} & \multicolumn{1}{c!{\hspace{2.4pt}}}{ddddddd} & \multicolumn{1}{!{\hspace{-0.4pt}}c}{aaaaaaa} & \multicolumn{1}{c}{bbbbbbb} & \multicolumn{1}{c}{ccccccc} & \multicolumn{1}{c}{ddddddd} \\
\arrayrulecolor{black}
    \hhline{----::----}
    0.536 & 0.600 & 0.392 & 0.736 & 0.509 & 0.454 & 0.500 & 0.500 \\
    \hhline{----||----}
    0.600 & 0.570 & 0.592 & 0.536 & 0.675 & 0.693 & 0.552 & 0.500 \\
    \hhline{----||----}
     0.578 & 0.447 & 0.496 & 0.316 & 0.535 & 0.510 & 0.433 & 0.426 \\
    \hhline{----||----}
     0.626 & 0.588 & 0.569 & 0.591 & 0.615 & 0.623 & 0.536 & 0.452 \\
    \hhline{----||----}
     0.673 & 0.563 & 0.544 & 0.483 & 0.613 & 0.425 & 0.500 & 0.500 \\
    \hhline{----||----}
     0.537 & 0.434 & 0.522 & 0.397 & 0.518 & 0.436 & 0.500 & 0.500 \\
    \hhline{----||----}
      0.697 & 0.523 & 0.604 & 0.681 & 0.522 & 0.559 & 0.507 & 0.486 \\
    \hhline{----||----}
    \hline
    \end{tabular}
    \caption{Caption}
    \end{table*}

    \end{document} 

enter image description here

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.