4

How can I leave some empty cells in a table?

\documentclass[a4paper,english,12pt,oneside]{book}

\usepackage[left=20mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{mathtools}

\usepackage{graphics}
\usepackage{tabularx}
\usepackage{geometry}
\usepackage{multirow}
\usepackage{slashbox}


\begin{document}

\begin{tabular}{|c|c|c|c|}
\hline
\backslashbox{x}{y}  & Scalar & Vector & Matrix\\
\hline
Scalar & $\frac{dy}{dx}$ & $\frac{dy}{dx} = \left[\frac{\partial y_i}{\partial x} \right]$ & $\frac{dY}{dx} = \frac{\partial y_{ij}}{\partial x}$ \\
\hline
Vector & $\frac{dy}{dx} = \left[\frac{\partial y}{\partial x_j} \right]$ & $\frac{dy}{dx} = \left[\frac{\partial y_i}{\partial x_j} \right]$\\
\hline
Matrix & $\frac{dy}{dX} = \left[\frac{\partial y}{\partial x_{ji}} \right]$\\
\hline
\end{tabular}

\end{document}
2

3 Answers 3

8

If you add column delimiters (&) with just a white space in-between, you get empty cells.

In your example, the last two rows could be modified like this:

\hline
Vector & $\frac{dy}{dx} = \left[\frac{\partial y}{\partial x_j} \right]$ & $\frac{dy}{dx} = \left[\frac{\partial y_i}{\partial x_j} \right]$ & \\
\hline
Matrix & $\frac{dy}{dX} = \left[\frac{\partial y}{\partial x_{ji}} \right]$ & &\\
\hline
1
  • 3
    It does not work for the first cell in a row.
    – yujaiyu
    Commented Feb 13, 2019 at 20:31
6

I'm posting this answer because googling for "empty space table" led me here and the answers are not quite what I needed. I know how to create a cell that is empty, but I needed blank space to print out the .pdf later and fill it by hand.

To include empty cells in a table large enough to write something by hand, you can use the \vspace command.

MWE:

\documentclass{article}
\begin{document}
    \begin{center}
        \begin{tabular}{| p{4.5cm} |p{4cm} | p{4cm}|}
            \hline
            Date & War parties  & War zones  \\ \hline
            \vspace{5cm} &  &   \\ 
            \hline
        \end{tabular}
    \end{center}
\end{document}

Output:

enter image description here

2

You could take as an example the table below.

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{booktabs}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\begin{document}
   \begin{table}[!ht]
     \caption{aaaaaaaaaaaaaa}\label{tab:aaaaaaaa}
     \centering
     \begin{tabular}{*{15}{c}}\toprule
       \multicolumn{10}{c}{Outputs} & 33 & 3 & 3 & 3 & Clock \\ \midrule
       & & & & & & & & & & 1 & 1 & 0 & 1 & $t_0$ \\
       & & & & & & & & & 1 & 1 & 0 & 1 & 0 & $t_1$ \\
       & & & & & & & & & & & & & & \vdots \\
       1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & $t_{10}$ \\       
       $a_0$ & $a_1$ & $a_2$ & $a_3$ & $a_4$ & $a_5$ & $a_6$ & $a_0$ & $a_1$ & $a_2$ & $a_3$ & $a_4$ & $a_5$ & $a_6$ & \\ \bottomrule
     \end{tabular}
   \end{table}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .