4

I want to put two tables on one page but when it won't be positioned at the top of the page. this is the code:

\documentclass[
a4paper,
12pt,
blue,
rgb,
]{tubsbook}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{array,multirow}
\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
\usepackage{graphicx}
\usepackage[activate]{pdfcprot}

\begin{document}
\begin{table}[htb]
\centering
\renewcommand\arraystretch{1.2}
\begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
\hline
\mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
\mcbf{Core clock}                                   & 800 MHz           \\ \hline
\multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
                            &  Associativity    & 8                 \\ \cline{2-3}
                            &  Latency          & 8                 \\ \cline{2-3}
                            &  MSHRs            & 11                \\ \cline{2-3}
                            &  Write buffers    & 9                 \\ \hline
\multirow{4}{*}{L1 - I}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 2                 \\ \hline
\multirow{5}{*}{L1 - D}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 4                 \\ \cline{2-3}
                            &  Write buffers    & 16                \\ \hline
{Stride prefetcher}            &  Degree           & 1                 \\ \hline
\multirow{2}{*}{Global BP}     &  Entries          & 4096              \\ \cline{2-3}
                            &  Bits             & 2                 \\ \hline
\mlbf{BTB entries}                                  & 4096              \\ \hline
\mlbf{Return Address Stack (RAS) entries}           & 8                 \\ \hline
\mlbf{Issues width}                                 & 2                 \\ \hline
\mlbf{Pipeline stages}                              & 8                 \\ \hline
\mlbf{Physical INT registers}                       & 62                \\ \hline
\mlbf{Physical FP registers}                        & 256               \\  \hline
\mlbf{IQ entries}                                   & 32                \\ \hline
\mlbf{LSQ entries}                                  & 8 / 8             \\ \hline
\mlbf{ROB entries}                                  & 40                \\ \hline
\end{tabular}%
\caption{My caption}
\label{my-label}
\end{table}
\end{document}

And this is how the table is positioned: enter image description here

  • 2
    your question asks why two tables are not placed on a page but your example only has one table. What answer do you want? You will get one or two tables on the page depending if the unshown second table is small enough to fit – David Carlisle Aug 20 '16 at 22:32
  • 1
    tables on float pages are vertically positioned by default but obviously this one would move up if there was a second table – David Carlisle Aug 20 '16 at 22:33
  • 2
    add a second table, and some text and that will most likely happen – David Carlisle Aug 20 '16 at 22:33
  • 1
    See, if the table option change from [htb] to [!ht] will help. – Zarko Aug 20 '16 at 22:38
  • 1
    @Zarko best not to recommend ! initially it's a sledgehammer of last resort for special cases where you want to over-ride the documentclass – David Carlisle Aug 20 '16 at 22:40
2

See: two tables on one page.

\documentclass[
a4paper,
12pt,
blue,
rgb,
]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{hyperref}
\usepackage{array,multirow}
\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
\usepackage{graphicx}
\usepackage[activate]{pdfcprot}
\usepackage[margin=1in]{geometry}

\begin{document}
\begin{table}[p]
\centering
\renewcommand\arraystretch{1.2}
\begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
\hline
\mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
\mcbf{Core clock}                                   & 800 MHz           \\ \hline
\multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
                            &  Associativity    & 8                 \\ \cline{2-3}
                            &  Latency          & 8                 \\ \cline{2-3}
                            &  MSHRs            & 11                \\ \cline{2-3}
                            &  Write buffers    & 9                 \\ \hline
\multirow{4}{*}{L1 - I}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 2                 \\ \hline
\multirow{5}{*}{L1 - D}        &  Size             & 32 kB             \\ \cline{2-3}
                            &  Associativity    & 4                 \\ \cline{2-3}
                            &  Latency          & 1                 \\ \cline{2-3}
                            &  MSHRs            & 4                 \\ \cline{2-3}
                            &  Write buffers    & 16                \\ \hline
{Stride prefetcher}            &  Degree           & 1                 \\ \hline
\multirow{2}{*}{Global BP}     &  Entries          & 4096              \\ \cline{2-3}
                            &  Bits             & 2                 \\ \hline
\mlbf{BTB entries}                                  & 4096              \\ \hline
\mlbf{Return Address Stack (RAS) entries}           & 8                 \\ \hline
\mlbf{Issues width}                                 & 2                 \\ \hline
\mlbf{Pipeline stages}                              & 8                 \\ \hline
\mlbf{Physical INT registers}                       & 62                \\ \hline
\mlbf{Physical FP registers}                        & 256               \\  \hline
\mlbf{IQ entries}                                   & 32                \\ \hline
\mlbf{LSQ entries}                                  & 8 / 8             \\ \hline
\mlbf{ROB entries}                                  & 40                \\ \hline
\end{tabular}%
\caption{My caption}
\label{my-label}
\end{table}
\begin{table}[p]
    \centering
    \renewcommand\arraystretch{1.2}
    \begin{tabular}{|>{\bfseries}c|>{\bfseries}l|c|}
        \hline
        \mcbf{Cortex A9 Parameters}                         & \textbf{Values}   \\ \hline
        \mcbf{Core clock}                                   & 800 MHz           \\ \hline
        \multirow{5}{*}{L2}             &  Size             & 512 kB            \\ \cline{2-3}
        &  Associativity    & 8                 \\ \cline{2-3}
        &  Latency          & 8                 \\ \hline
    \end{tabular}%
    \caption{My caption}
    \label{my-label2}
\end{table}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.