Skip to content

Instantly share code, notes, and snippets.

@kevin-deyoungster
Last active November 20, 2022 23:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kevin-deyoungster/3e716b8eba5962a4f46d369b4d6b3036 to your computer and use it in GitHub Desktop.
Save kevin-deyoungster/3e716b8eba5962a4f46d369b4d6b3036 to your computer and use it in GitHub Desktop.
Two-column wide table in LaTeX
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{adjustbox}
\begin{document}
\lipsum[1-5] % To create a random first page
\begin{table}[ht]
\centering
\begin{tabular}{|l|l|l|l|l|l|l|l|}
\hline
\textbf{Heading 1} & \textbf{Heading 2} & \textbf{Heading 3} & \textbf{Heading 4} & \textbf{Heading 5} & \textbf{Heading 6} & \textbf{ Heading 7} & \textbf{ Heading 8} \\
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\end{tabular}
\caption{Table 1: In-text Table}
\label{tab:1}
\end{table}
\begin{table*}[ht]
\centering
\begin{tabular}{ |l|l|l|l|l|l|l|l| }
\hline
\textbf{Heading 1} & \textbf{Heading 2} & \textbf{Heading 3} & \textbf{Heading 4} & \textbf{Heading 5} & \textbf{Heading 6} & \textbf{ Heading 7} & \textbf{ Heading 8} \\
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\end{tabular}
\caption{Wide Table}
\label{tab:1}
\end{table*}
\begin{table*}[ht]
\caption{Table 3}
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{ |l|l|l|l|l|l|l|l| }
\hline
\textbf{Heading 1} & \textbf{Heading 2} & \textbf{Heading 3} & \textbf{Heading 4} & \textbf{Heading 5} & \textbf{Heading 6} & \textbf{ Heading 7} & \textbf{ Heading 8} \\
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\hline
This is section 1 & This is section 2 & This is section 3 & This is section 4 & This is section 5 & This is section 6 & This is section 7 & This is section 8 \\
\hline
\end{tabular}
}
\end{table*}
\lipsum[1-6]
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment