4
\begin{table}[h]
\centering
\caption{My Caption}
\label{my-label}\smallskip
\begin{tabular}{c|c c c}
\small{Text} & \small{Qgc} & \small{Qgc} & \small{Qgc}  \\  & \small{{[}MVar{]}} & \small{{[}MVar{]}} & \small{{[}MVar{]}}  \\ \hline
\small{A}           & \small{-100}                        & \small{100.00}                  & \small{100}                         \\
\small{B}           & \small{-100}                        & \small{100}                     & \small{100}                         \\
\small{C}           & \small{-100}                        & \small{100}                     & \small{100}                         \\
\end{tabular}
\end{table}
4

Just some notes on your table:

  1. Instead of repeating \small everywhere, just add small at the beginning. Also \small is a switch not a command, it has no {}.

  2. Columns 2 through 4 are mainly numeric data, so it is best put in math-mode by adding >{$}c<{$} as their column specification.

  3. The same column header Qgc [MVar] is repeated three times, so just \multicolumn{3}{c}{Qgc [MVar]} will suffice.

  4. Removing all vertical rules and using booktabs can further improve the readability.

  5. Better off leave LaTeX decide the best place to put your table instead of forcing this here [h] specifier. At a final revision, though, you can move the table code part up or down in text to change the position where the table appears.

.

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]
\small\centering
\caption{My Caption}
\label{my-label}
\begin{tabular}{@{}c *3{>{$}c<{$}}@{}}
\toprule
Text     & \multicolumn{3}{c}{Qgc [MVar]}   \\ \cmidrule(r){1-1} \cmidrule(l){2-4}
A        & -100       & 100.00      & 100   \\
B        & -100       & 100         & 100   \\
C        & -100       & 100         & 100   \\ \bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

3

A comment up front: You're not using the \small directive correctly: It does not take an argument. Hence, inside a table cell, \small{Qgc} does the same as \small Qgc. Better to cut down on code clutter, right?

Second, since the contents of every single cell of the tabular environment are supposed to be rendered in \small, it's preferable to simply issue a \small directive before starting the tabular environment (and removing the \small directives from the individual cells).

Third, if you're going to make the contents of the tabular environment smaller, it's a good idea, typographically speaking, to make the associated \caption material smaller as well. An easy way to achieve this is to load the caption package and to issue a suitable \captionsetup directive immediately before the \caption statement.

Do also remember to typeset negative numbers in math mode to generate typographically appropriate - (math-mode "minus") signs, rather than simple dashes.

Last (and possibly least, in my opinion), use a \multirow statement (provided by the multirow package) to center the label "Text" vertically.

enter image description here

\documentclass{article}
\usepackage{multirow}
\usepackage[skip=0.333\baselineskip]{caption}
\begin{document}

\begin{table}[h]
\centering

\caption{Original version}
\label{version:one}
\begin{tabular}{c|c c c}
\small{Text} & \small{Qgc} & \small{Qgc} & \small{Qgc}  \\  
             & \small{{[}MVar{]}} & \small{{[}MVar{]}} & \small{{[}MVar{]}}  \\ 
\hline
\small{A}           & \small{-100}     & \small{100.00}    & \small{100}   \\
\small{B}           & \small{-100}     & \small{100}       & \small{100}   \\
\small{C}           & \small{-100}     & \small{100}       & \small{100}   \\
\end{tabular}

\bigskip

\captionsetup{font=small}
\caption{Modified Version}
\label{version:two}
\small
\begin{tabular}{c|c c c}
\multirow{2}{*}{Text} &   Qgc  &   Qgc  &   Qgc   \\  
                      & [MVar] & [MVar] & [MVar]  \\ 
\hline
A       & $-100$  & 100.00  & 100  \\
B       & $-100$  & 100     & 100  \\
C       & $-100$  & 100     & 100  \\
\end{tabular}
\end{table}
\end{document}
3

A solution without multirows nor multicolumns but with m columns.

The second table deal with the case that other columns must be of another type (with decimal alignment in this case, note the correct sign in "-100" with the S columns of the siunitx package) using a \parbox to allow line breaks in the headers.

Note also that in this case the column width could be due to the \parbox width, or to the space reserved for digits before/after the decimal point (case of the example).

mwe

\documentclass{article}
\usepackage{array,siunitx,booktabs}
\newcolumntype{T}{>{\centering\arraybackslash}m{3em}}
\newcolumntype{U}{S[table-format=4.2]}
\setlength{\belowcaptionskip}{1em}
\begin{document}
\begin{table}
\centering
\caption{My Caption}
\label{my-label}
\small
\begin{tabular}{TTTT}\toprule
Text & Qgc [MVar] & Qgc [MVar] & Qgc [MVar] \\\midrule
A & -100 & 100.00 & 100\\
B & -100 & 100    & 100\\
C & -100 & 100    & 100\\\bottomrule
\end{tabular}
\caption{My Caption}
\begin{tabular}{TUUU}\toprule
Text & 
\parbox{3em}{\centering Qgc [MVar]} &
\parbox{3em}{\centering Qgc [MVar]} &
\parbox{3em}{\centering Qgc [MVar]}\\\midrule
A & -100 & 100.00 & 100\\
B & -100 & 10    & 100\\
C & -100 & 1.0    & 100\\\bottomrule
\end{tabular}
\end{table}
\end{document}
2

Here is a solution by using multirow package:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
%opening
\title{}
\author{}

\begin{document}

\begin{table}[h]
\centering
\caption{My Caption}
\label{my-label}\smallskip
\begin{tabular}{c|c c c}
\multirow{2}{*}{\small{Text}} & \small{Qgc} & \small{Qgc} & \small{Qgc}  \\  & \small{{[}MVar{]}} & \small{{[}MVar{]}} & \small{{[}MVar{]}}  \\ \hline
\small{A}           & \small{-100}                        & \small{100.00}                  & \small{100}                         \\
\small{B}           & \small{-100}                        & \small{100}                     & \small{100}                         \\
\small{C}           & \small{-100}                        & \small{100}                     & \small{100}                         \\
\end{tabular}
\end{table}

\end{document}

Result: enter image description here

2

Move Text into position with \raisebox, or use \makecell's default placement (vertical/horizontal centre):

enter image description here

\documentclass{article}

\usepackage{booktabs,makecell}

\begin{document}

\begin{table}
  \centering
  \begin{tabular}{c c c c}
    \toprule
    \raisebox{-.5\normalbaselineskip}[0pt][0pt]{Text} 
            &   Qgc  &   Qgc  &   Qgc  \\  
            & [MVar] & [MVar] & [MVar] \\ 
    \midrule
    A       & $-100$  & 100.00  & 100  \\
    B       & $-100$  & 100     & 100  \\
    C       & $-100$  & 100     & 100  \\
    \bottomrule
  \end{tabular}

  \bigskip

  \begin{tabular}{c c c c}
    \toprule
    Text    & \makecell{Qgc \\{}[MVar]} & \makecell{Qgc \\{}[MVar]} & \makecell{Qgc \\{}[MVar]} \\
    \midrule
    A       & $-100$  & 100.00  & 100  \\
    B       & $-100$  & 100     & 100  \\
    C       & $-100$  & 100     & 100  \\
    \bottomrule
  \end{tabular}

\end{table}

\end{document}

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.