1

I wrote the following table:

    \begin{center}
        \begin{tabular}{c|c c c c c}
             $\bigoplus$ & 0 & 1 & 2 & 3 & 4\\
             \hline
             0 & 0 & 1 & 2 & 3 & 4\\
             1 & 1 & 2 & 3 & 4 & 0\\
             2 & 2 & 3 & 4 & 0 & 1\\
             3 & 3 & 4 & 0 & 1 & 2\\
             4 & 4 & 0 & 1 & 2 & 3\\
        \end{tabular}
        \quad
        \begin{tabular}{c|c c c c c}
            $\bigodot$ & 0 & 1 & 2 & 3 & 4\\
            \hline
             0 & 0 & 0 & 0 & 0 & 0\\
             1 & 0 & 1 & 2 & 3 & 4\\
             2 & 0 & 2 & 4 & 1 & 3\\
             3 & 0 & 3 & 1 & 4 & 2\\
             4 & 0 & 4 & 3 & 2 & 1\\
        \end{tabular}
    \end{center}

I want to name my first table 9.1 and second table 9.2 How can I do that please help

Roland
  • 6,655
  • You have to wrap your tabulars in table environments, and add a caption (and maybe a label for future reference) – NBur Oct 15 '21 at 15:42
  • \Welcome to ReX.SE! Like \begin{table[htb] \caption{caption text}\label{tab:a} \begin{tabular}{c|c c c c c} ... – Zarko Oct 15 '21 at 15:44

1 Answers1

2

Like this?

enter image description here

\documentclass{article}
\renewcommand\thetable{\thesection.\arabic{table}}

\begin{document}

\setcounter{section}{8} % for this example only \section{tables} \begin{table}[ht] \begin{minipage}{0.48\linewidth} \centering \caption{Caption 1 text} \label{tab:a} \begin{tabular}{c|c c c c c} $\bigoplus$ & 0 & 1 & 2 & 3 & 4\ \hline 0 & 0 & 1 & 2 & 3 & 4\ 1 & 1 & 2 & 3 & 4 & 0\ 2 & 2 & 3 & 4 & 0 & 1\ 3 & 3 & 4 & 0 & 1 & 2\ 4 & 4 & 0 & 1 & 2 & 3\ \end{tabular} \end{minipage} \hfill \begin{minipage}{0.48\linewidth} \caption{Caption 2 text} \label{tab:b} \centering \begin{tabular}{c|c c c c c} $\bigodot$ & 0 & 1 & 2 & 3 & 4\ \hline 0 & 0 & 0 & 0 & 0 & 0\ 1 & 0 & 1 & 2 & 3 & 4\ 2 & 0 & 2 & 4 & 1 & 3\ 3 & 0 & 3 & 1 & 4 & 2\ 4 & 0 & 4 & 3 & 2 & 1\ \end{tabular} \end{minipage} \end{table} \end{document}

Zarko
  • 296,517