Como posso dividir uma seção da página em três partes?

Como posso dividir uma seção da página em três partes?

Estou trabalhando no papel LaTex e descobri que estou usando três pequenas tabelas que quero caber em apenas uma parte da página, não quero dividir a página inteira. Isto é o que parece agora:

insira a descrição da imagem aqui

E eu quero que eles sejam colocados todos em uma linha horizontal e este é o meu código até agora.

\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}

% compuerta OR

\begin{table}[ht!]
\centering
\caption{Compuerta OR}
\label{tab1}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 1               \\ \hline
1          & 0          & 1               \\ \hline
1          & 1          & 1               \\ \hline
\end{tabular}
\end{table}

% compuerta AND

\begin{table}[ht!]
\centering
\caption{Compuerta AND}
\label{tab2}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 0               \\ \hline
1          & 0          & 0               \\ \hline
1          & 1          & 1               \\ \hline
\end{tabular}
\end{table}

% compuerta XOR

\begin{table}[ht!]
\centering
\caption{Compuerta XOR}
\label{tab3}
\begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 1               \\ \hline
1          & 0          & 1               \\ \hline
1          & 1          & 0               \\ \hline
\end{tabular}
\end{table}

Desde já, obrigado!!! :)

Responder1

É muito simples com o floatrow pacote e seu ambiente de mesmo nome:

    \documentclass{article}

    \usepackage{floatrow}

    \begin{document}

    \noindent
    \textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}

    % compuerta OR
    \begin{table}[ht!]
    \begin{floatrow}[3]
    \centering
    \ttabbox{\caption{Compuerta OR}\label{tab1}}%
    {\begin{tabular}{|c|c|c|}
    \hline
    \textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
    0 & 0 & 0 \\ \hline
    0 & 1 & 1 \\ \hline
    1 & 0 & 1 \\ \hline
    1 & 1 & 1 \\ \hline
    \end{tabular}}
    % compuerta AND
    \ttabbox{\caption{Compuerta AND}\label{tab2}}%
    {\begin{tabular}{|c|c|c|}
    \hline
    \textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
    0 & 0 & 0 \\ \hline
    0 & 1 & 0 \\ \hline
    1 & 0 & 0 \\ \hline
    1 & 1 & 1 \\ \hline
    \end{tabular}}
    %
    \ttabbox{\caption{Compuerta XOR}\label{tab3}}%
    {\begin{tabular}{|c|c|c|}
    \hline
    \textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
    0 & 0 & 0 \\ \hline
    0 & 1 & 1 \\ \hline
    1 & 0 & 1 \\ \hline
    1 & 1 & 0 \\ \hline
    \end{tabular}}

    \end{floatrow}
    \end{table}

    \end{document} 

insira a descrição da imagem aqui

Responder2

  • Você não fornece sobre classe de documento usada e não de layout de página...
  • usar articlecom layout de página padrão e minipáginas fornece:

insira a descrição da imagem aqui

\documentclass{article}
\usepackage[skip=1ex, font=small]{caption} % <---


\begin{document}
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}

    \begin{table}[ht!]
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta OR}
\label{tab1}
    \begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 1               \\ \hline
1          & 0          & 1               \\ \hline
1          & 1          & 1               \\ \hline
    \end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta AND}
\label{tab2}
    \begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 0               \\ \hline
1          & 0          & 0               \\ \hline
1          & 1          & 1               \\ \hline
    \end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta XOR}
\label{tab3}
    \begin{tabular}{|c|c|c|}
\hline
\textbf{A} & \textbf{B} & \textbf{Output} \\ \hline
0          & 0          & 0               \\ \hline
0          & 1          & 1               \\ \hline
1          & 0          & 1               \\ \hline
1          & 1          & 0               \\ \hline
    \end{tabular}
\end{minipage}
\end{table}
\end{document}

Termo aditivo: você pode gostar do seguinte design de tabelas verdadeiras:

\documentclass{article}
\usepackage[skip=1ex, font=small]{caption}
\usepackage{tabularray}


\begin{document}
\noindent
\textbf{Escriba las tablas de verdad de una compuerta OR, AND y XOR.}

    \begin{table}[ht!]
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta OR}
\label{tab1}
    \begin{tblr}{colspec = { c c|c },
                  row{1} = {font=\bfseries}
                 } 
A   & B & Output    \\ 
    \hline
0   & 0 & 0         \\
0   & 1 & 1         \\
1   & 0 & 1         \\
1   & 1 & 1         \\
    \end{tblr}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta AND}
\label{tab2}
    \begin{tblr}{colspec = { c c|c },
                  row{1} = {font=\bfseries}
                 }
A   & B & Output    \\
    \hline
0   & 0 & 0         \\
0   & 1 & 0         \\
1   & 0 & 0         \\
1   & 1 & 1         \\
    \end{tblr}
\end{minipage}
\hfill
\begin{minipage}{0.3\linewidth}\centering
\caption{Compuerta XOR}
\label{tab3}
    \begin{tblr}{colspec = { c c|c },
                  row{1} = {font=\bfseries}
                 }
A   & B & Output    \\
    \hline
0   & 0 & 0         \\
0   & 1 & 1         \\
1   & 0 & 1         \\
1   & 1 & 0         \\ 
    \end{tblr}
\end{minipage}
\end{table}
\end{document}

insira a descrição da imagem aqui

informação relacionada