[Tex/LaTex] How to float table in landscape environment

floatslandscapetables

I have a wide table, so I put it into the landscape environment. Unfortunately, the float does not work any more. The new page in landscape begins exactly where I included it.

\documentclass[11pt,titlepage,listof=totoc,bibliography=totoc]{scrartcl}

\usepackage[english]{babel}                 % English language
\usepackage[T1]{fontenc}                    % German characters etc.
\usepackage[utf8]{inputenc}                 % German characters etc.
\usepackage{apacite}                        % For the bibliographystyle
\usepackage{bibgerm}                        % Stylepackage
\usepackage{enumerate}                      % For enumerations
\usepackage{graphicx}                       % For figures
\usepackage{caption}                        % For graphicx-cations
\usepackage{subcaption}                     % For graphicx-subcations
\usepackage{setspace}                       % For line spacing
\usepackage[paper=a4paper,left=35mm,right=35mm,top=30mm,bottom=30mm]{geometry} 
\usepackage{pdflscape}                      % For horizontal format
\usepackage{tabularx}                       % For tables
\usepackage{multirow}                       % For multiple rows in table
\usepackage{float}                          % Prevents moving images with [H] 
\usepackage{acronym}                        % For abbreviations 
\usepackage{url}
\usepackage{color}                          % For coloured texts 

\begin{document}

Text, text ...

\begin{landscape}
\begin{table}[ht]
\centering
    \caption{Example}
\begin{tabular}{l||ccccc|c|c}
    \hline
      & Text & Text & Text & Text & Text & Text & Text \\
    \hline
    Text & 5 & 4 & 2 & 3 & 4 & 3 & \\
    Text & 1 & 0 & 3 & - & 2 & 5 & 5 \\
    \hline
\end{tabular}
\end{table}
\end{landscape}

Text, text ...

\newpage
\bibliographystyle{apacite}
\bibliography{bib}

\end{document}

Best Answer

You can use sidewaystable from rotating package. Just change table to sidewaystable and get rid of landscape environment.

\documentclass{article}
\usepackage{lipsum}
\usepackage{rotating}
\begin{document}
  \lipsum[1]
\begin{sidewaystable}[ht]
\centering
    \caption{Example}
\begin{tabular}{l||ccccc|c|c}
    \hline
      & Text & Text & Text & Text & Text & Text & Text \\
    \hline
    Text & 5 & 4 & 2 & 3 & 4 & 3 & \\
    Text & 1 & 0 & 3 & - & 2 & 5 & 5 \\
    \hline
\end{tabular}
\end{sidewaystable}
  \lipsum
\end{document}