3

This is my table:

https://dl.dropboxusercontent.com/u/52838329/tabular.png

I have a few problems:

  1. I want both columns to take each 50% of the page width (excl margin), but the second column's text needs to be aligned right.
  2. The last vertical line is not correctly placed
  3. The first and last row need to be a bit higher so the text fits better.

    \begin{tabularx}{\textwidth}{|p{0.5\textwidth}|p{0.5\textwidth}|}
    \hline
    \textbf{{\Large Activa}} & \textbf{{\Large Passiva}}\\ \hline
    \hline 
    \textbf{Aanwendingsvormen} van het vermogen & \textbf{Vermogensbronnen}\\
    
    \begin{itemize}
    \item Bezittingen
    \item Vorderingen
    \end{itemize}
    &
    \begin{itemize}
    \item Eigen vermogen
    \item Vreemd vermogen
    \end{itemize}\\
    
    \textbf{Ondernemingsmiddelen} & \textbf{Ondernemingsbronnen}\\
    Welke middelen heeft de onderneming om haar activiteit te ontwikkelen? & Hoe financiert de onderneming de ondernemingsmiddelen.\\
    \hline \hline
    \textbf{{\Large Vermogen} van de onderneming} & \textbf{{\Large Vermogen} van de onderneming}\\\hline
    \end{tabularx}
    

I didn't find anything on this, so any help is appreciated!

Moriambar
  • 11,466
Aaron
  • 649

1 Answers1

2

Here are some things you need to do:

  • Use \textbf{\Large\strut ...} in one of the header entries. This inserts a vertical strut of the appropriate size to obtain better spacing. There's also more ideas in terms of vertical adjustment of table entries in Column and row padding in tables.

  • Include the array package in your preamble

    \usepackage{array}% http://ctan.org/pkg/array
    

    and use a tabularx column specification of the form

    \begin{tabularx}{\textwidth}{|>{\raggedright}X|>{\raggedleft\arraybackslash}X|}
    % ...
    \end{tabularx}
    

    This inserts \raggedright [\raggedleft] in the first [second] column so items should be left- [right-]aligned. Note that lists do not conform to this adjustment. To that end, I've used varwidth's varwidth environment for capturing the list in a box of natural width (if it is smaller than the width of the column, or \linewidth).

  • Also, use \noindent before tabularx:

    \noindent
    \begin{tabularx}{\textwidth}{...}
    %...
    \end{tabularx}
    

    otherwise your tabularx position won't sit flush with the margins.

Here is a complete MWE:

enter image description here

\documentclass{article}
\usepackage{array,tabularx,varwidth}% http://ctan.org/pkg/{array,tabularx,varwidth}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{|>{\raggedright}X|>{\raggedleft\arraybackslash}X|}
  \hline
  \textbf{{\Large\strut Activa}} & \textbf{{\Large Passiva}} \\
  \hline\hline 
  \textbf{Aanwendingsvormen} van het vermogen & \textbf{Vermogensbronnen} \\[1.5\normalbaselineskip]
  \begin{varwidth}[t]{\linewidth}
    \begin{itemize}
      \item Bezittingen
      \item Vorderingen
    \end{itemize}
  \end{varwidth} &
  \begin{varwidth}[t]{\linewidth}
    \begin{itemize}
      \item Eigen vermogen
      \item Vreemd vermogen
    \end{itemize}
  \end{varwidth} \\[2\normalbaselineskip]
  \textbf{Ondernemingsmiddelen} & \textbf{Ondernemingsbronnen} \\
  Welke middelen heeft de onderneming om haar activiteit te ontwikkelen? & 
  Hoe financiert de onderneming de ondernemingsmiddelen.\\
  \hline\hline
  \textbf{{\Large\strut Vermogen} van de onderneming} & 
  \textbf{{\Large Vermogen} van de onderneming} \\
  \hline
\end{tabularx}
\end{document}

Unknown (or incorrect) hyphenation patterns could also be problematic when it comes to line-breaking (not the case/issue here). If need be, you can manually force a different hyphenation using a blah\-blah\-blah approach.

Moriambar
  • 11,466
Werner
  • 603,163