1

I want to make my 2 column table span the width of my text, with the right column being left aligned. This is my attempt:

\documentclass[]{report}
\begin{document}

\begin{table}[h]
    \centering
    \label{tab:my-table}
    \begin{tabular}{l|l}
        \hspace{-0.3\textwidth}\textbf{Filler} & \textbf{Some Text}  \\ 
        \hline
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &               
    \end{tabular}
\end{table}
\end{document}

And this is the rather awkward result:

enter image description here

1
  • Should the two columns have the same width? If not, how should the widths be determined? Please advise.
    – Mico
    Commented Oct 13, 2019 at 17:02

1 Answer 1

2
\documentclass{report}

\begin{document}

\begin{table}[ht]
    \centering
    \label{tab:my-table}
    \begin{tabular}{p{\dimexpr0.5\linewidth-2\tabcolsep-0.5\arrayrulewidth}|
                    p{\dimexpr0.5\linewidth-2\tabcolsep-0.5\arrayrulewidth}
                    }
        \textbf{Filler} & \textbf{Some Text}  \\
        \hline
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &
    \end{tabular}
\end{table}
\end{document}

or

\documentclass{report}
\usepackage{tabularx}

begin{document}

\begin{table}[ht]
    \centering
    \label{tab:my-table}
    \begin{tabularx}{\linewidth}{X|X}
        \textbf{Filler} & \textbf{Some Text}  \\
        \hline
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &                \\
        &
    \end{tabularx}
\end{table}
\end{document}

In both cases the results are:

enter image description here

(red lines indicate text borders)

You must log in to answer this question.

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