Document ClassesTable

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
VikVol
Posts: 1
Joined: Wed Mar 30, 2022 2:41 pm

Table

Post by VikVol »

Hello I am writing my bachellor thesis and I want to insert a table using multirow but there is an error- probably because of the statement documentclass. For example not even this code is working:

Code: Select all

\documentclass[11pt]{article}
\begin{document}
 
\begin{table}[ht]
\caption{Partial horizontal line}
\begin{tabular}{ccc}
    \hline
    \multicolumn{2}{c}{Multi-column}&\\
    \cline{1-2}
    X&X&X\\
    X&X&X\\
    \hline
\end{tabular}
\end{center}
\label{tab:multicol}
\end{table}
 
\end{document}
Thank you in advance!
Last edited by Stefan Kottwitz on Fri Apr 01, 2022 10:53 am, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

Table

Post by Bartman »

Please use the code tags to mark your code.

I only see the summary of columns but not of rows.

The center environment is ended without having been started. It not only centers its content, but also adds vertical spaces before and after it, which is already done by the floating environment.

Code: Select all

\documentclass[11pt]{article}

\begin{document}
\begin{table}[ht]
\centering% added to center the content
\caption{Partial horizontal line}
\label{tab:multicol}% moved in favor of the overview
\begin{tabular}{ccc}
\hline
\multicolumn{2}{c}{Multi-column}&\\
\cline{1-2}
X&X&X\\
X&X&X\\
\hline
\end{tabular}
%\end{center}
\end{table}
\end{document}
You may be interested in the booktabs package.
Post Reply