[Tex/LaTex] Table too wide for page

hyphenationlongtable

I am trying to fit a rather large table to my page. It is to wide for the page. I tried something like

\begin{longtable}{| p{0.14\textwidth} | p{0.14\textwidth} | 
p{0.14\textwidth} | p{0.14\textwidth} | p{0.14\textwidth} | 
p{0.14\textwidth} | p{0.14\textwidth} |}

because I have seven columns.

One of the problems I now have is that, as I'm using scrartcl, the annotation space is included into \textwidth too, but of course I want to stay inside the normal limits.

Also, I am already using footnotesize, but it does not separate words –> if they are too long, they are partially written in the next column.

I now need a method, that fits the table into the "normal" page width (as shown by showframe) and also adds a linebreak or separates words, in order to avoid writing into the next column.

I didn't post a minimal example, because I'm open to every possible solution, (but it should use something like longtable and, if possible, adjust the column size in relation to the \textwidth).
(sorry if this looks a bit messy)

\begin{footnotesize}
\begin{center}
  \begin{longtable}{| p{0.14\textwidth} | p{0.14\textwidth} |
  p{0.14\textwidth} | p{0.14\textwidth} | p{0.14\textwidth} | 
  p{0.14\textwidth} | p{0.14\textwidth} |}
    \hline 
  \textbf{Variable} & \textbf{Kurzbezeichnung} & \textbf{Frage} & \textbf{type} & \textbf{value label} & \textbf{Range} & \textbf{missing value}\\
  \hline
  \endhead % all the lines above this will be repeated on every page
  ffhrwoggbgbgfieh & fefgogergeroigregb & fhoergregre & fhoerghergie & herogheggire & hgieghrgri & ngjreoigehrero\\
  \hline
  \caption{Alle Variablen von der Dokumentation aus dem Codebuch.}
  \label{tab:VarDoku}
  \end{longtable}
\end{center}
\end{footnotesize}

Best Answer

There's no way “Kurzbezeichnung” can be accommodated in such a narrow width, so I abbreviated it into ”KB”.

\documentclass{article}
\usepackage{longtable,calc,array}

\newlength\alicewidth

\begin{document}

\begingroup\footnotesize
\setlength{\alicewidth}{\textwidth/7-2\tabcolsep-8\arrayrulewidth/7}
\begin{longtable}{|*{7}{>{\raggedright\arraybackslash}p{\alicewidth}|}}
\hline
\textbf{Variable} & \textbf{KB} & \textbf{Frage} &
  \textbf{type} & \textbf{value label} & \textbf{Range} & \textbf{missing value}\\
\hline
\endhead % all the lines above this will be repeated on every page

ffhrwo ggbgbg fieh & fefgo gerge roigr egb & fhoerg regre & fhoerg hergie &
 herogh eggire & hgieg hrgri & ngjreoi gehrero\\

\hline
\caption{Alle Variablen von der Dokumentation aus dem Codebuch.\label{tab:VarDoku}}
\end{longtable}
\endgroup

\end{document}

enter image description here

Related Question