0

enter image description here

Does anyone know why my board is cut?

\begin{document}
\maketitle
\begin{table}[h]
\centering
\begin{tabular}{lllllll}
Primer entero &
  Segundo entero &
  \begin{tabular}[c]{@{}l@{}}Valor suma \\ según calculadora\end{tabular} &
  \begin{tabular}[c]{@{}l@{}}Valor resta \\ según calculadora\end{tabular} &
  \begin{tabular}[c]{@{}l@{}}Valor producto \\ según calculadora\end{tabular} &
  \begin{tabular}[c]{@{}l@{}}Valor cociente \\ según calculadora\end{tabular} &
  \begin{tabular}[c]{@{}l@{}}Valor resto \\ según calculadora\end{tabular} \\
0 & 2 & 2  & -2 & 0  & 0   & 0 \\
2 & 0 & 2  & 2  & 0  & -   & - \\
4 & 4 & 8  & 0  & 16 & 1   & 0 \\
4 & 6 & 10 & -2 & 24 & 0.6 &   \\
2 & 9 & 11 & -7 & 18 & 0.2 &  
\end{tabular}
\end{table}

\end{document}
2
  • You have 7 fairly wide column headers, and you only specify (fairly wide) line breaks on five of them. The table is too wide, so it runs off the page. What would you like to happen instead?
    – Teepeemm
    Commented Oct 3, 2022 at 19:34
  • Compress the table more so that it comes out all in one Commented Oct 3, 2022 at 19:35

2 Answers 2

1

Here is a possible solution with the help of the geometry package (to help have more sensible margins) and the \thead command, from makecell:

     \documentclass{article}

     \usepackage{makecell}
    \title{tabletest}\author{Ego}
    \usepackage[showframe]{geometry}

    \begin{document}

    \maketitle
    \begin{table}[h]
    \centering \renewcommand{\theadfont}{\footnotesize\bfseries}
    \begin{tabular}{lllllll}
    \thead{Primer\\ entero} &
      \thead{Segundo\\ entero} &
      \thead[lc]{Valor suma \\ según\\ calculadora} &
      \thead[lc]{Valor resta \\ según\\ calculadora} &
      \thead[lc]{Valor producto \\ según\\ calculadora} &
      \thead[lc]{Valor cociente \\ según\\ calculadora} &
      \thead[lc]{Valor resto \\ según\\ calculadora} \\
    0 & 2 & 2 & $ -2 $ & 0 & 0 & 0 \\
    2 & 0 & 2 & 2 & 0 & $ - $ & $ - $ \\
    4 & 4 & 8 & 0 & 16 & 1 & 0 \\
    4 & 6 & 10 & $ -2 $ & 24 & 0.6 & \\
    2 & 9 & 11 & $ -7 $ & 18 & 0.2 &
    \end{tabular}
    \end{table}

    \end{document}

enter image description here

0

With the package tabularray and the package changepage

\documentclass{article}
\usepackage{tabularray}
%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}% for the test
%---------------------------------------------------------------%
\usepackage{changepage}%<-- to change page width locally
\begin{document}
\parindent=0pt
\lipsum{1}
\begin{adjustwidth}{-1cm}{-1cm}%<-- change the margin
  \begin{tblr}{
      hlines,vlines,
      colspec = {*{7}{X[m,c]}},%
      row{1}={font=\bfseries}
    }
    Primer entero & Segundo entero & Valor suma según calculadora & Valor resta según calculadora & Valor producto  según calculadora & Valor cociente según calculadora & Valor resto según calculadora \\
    0 & 2 & 2  & -2 & 0  & 0   & 0 \\
    2 & 0 & 2  & 2  & 0  & -   & - \\
    4 & 4 & 8  & 0  & 16 & 1   & 0 \\
    4 & 6 & 10 & -2 & 24 & 0.6 &   \\
    2 & 9 & 11 & -7 & 18 & 0.2 &
  \end{tblr}
\end{adjustwidth}
\lipsum{2}
\end{document}

enter image description here

You must log in to answer this question.

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