TransWikia.com

How to create Latex table with multiple row categories (such as subcategories)?

TeX - LaTeX Asked on July 2, 2021

I wish to create something similar to the following table

enter image description here

where Ozeki and Yokozuna are categories. I, II, III, etc. are sub categories, and Azuma, Santoro, Kenzo are items in the first column. The cells are to be inputted either numerical values or strings.

I am quite familiar with how to create something like

enter image description here

but clueless as to how to add that first "grand" category. I don’t even know what type of table I should use.

A minimal example should suffice. Outer border is not needed.

One Answer

Indeed, as @leandriis suggests in a comment, multicolumn will help you there. Here's a snippet that also uses the booktabs package to create a nice-looking table:

documentclass{article}
usepackage{booktabs}
begin{document}
begin{tabular}{lccccccc}
toprule
                     & multicolumn{3}{c}{textbf{Ozeki}} & multicolumn{4}{c}{textbf{Yokozuna}} 
cmidrule(lr){2-4}cmidrule(lr){5-8}
                     & I & II &            III            & I & II & III &           IV           
midrule
    textbf{Azuma}   &   &    &                           &   &    &     &                        
    textbf{Santoro} &   &    &                           &   &    &     &                        
    textbf{Kenzo}   &   &    &                           &   &    &     &                        
bottomrule
end{tabular}
end{document}

enter image description here

Correct answer by chsk on July 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP