2

I'm developing an overleaf article using the elsevier journal template. I made a table, but the margin does not respect the margin of the text, does anyone know how to solve?

enter image description here

\begin{table}[h]
\centering
\begin{tabular}{l l l l}
\hline
\textbf{Rede Convencional} & \textbf{Rede SG}\\
\hline
Medidores eletromecânicos & Medidores inteligentes \\
Geração centralizada de energia & Geração distribuída de energia \\
Pouco monitoramento do consumidor & Monitoramento em tempo real do conusmidor \\
Rede não-automatizada & Rede automatizada \\
\hline
\end{tabular}
\caption{Comparação entre rede convencional e rede SG \cite{ref10}.}
\end{table}
Mutante
  • 245

1 Answers1

6

I suggest you (a) load the tabularx and ragged2e packages and (b) switch from a tabular to a tabularx environment. Set its overall to \textwidth and specify 2 (not 4) columns of type X. For well-spaced horizontal lines, replace \hline with \toprule, \midrule, and \bottomrule -- all macros provided by the booktabs package -- as appropriate.

enter image description here

\documentclass{elsarticle}
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage{tabularx,ragged2e,booktabs}
\newcolumntype{L}{>{\RaggedRight\arraybackslash%
    \hangafter=1\hangindent=1em}X} % for automatic hanging indentation
\begin{document}

\begin{table}[h]
\begin{tabularx}{\textwidth}{@{} LL @{}}
\toprule
\textbf{Rede Convencional} & \textbf{Rede SG}\\
\midrule
Medidores eletromecânicos & Medidores inteligentes \\
Geração centralizada de energia & Geração distribuída de energia \\
Pouco monitoramento do consumidor & Monitoramento em tempo real do conusmidor \\
Rede não-automatizada & Rede automatizada \\
\bottomrule
\end{tabularx}
\caption{Comparação entre rede convencional e rede SG \cite{ref10}.}
\end{table}
Mico
  • 506,678