Graphics, Figures & TablesTable content not fitting in the page

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

Table content not fitting in the page

Post by Diogo Remoaldo »

Hi, I have the following code and I would like for the content in my table to adapt to the space of the collumn, so my table can fit the page.

As an end result I would like to get the table as shown in the appendix.

Code: Select all

\documentclass[openright,a4paper,12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
%\usepackage[fixlanguage]{babelbib}
%\selectbiblanguage{portuguese}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epstopdf} 
\usepackage{float}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{url}
\usepackage[all]{hypcap}
\usepackage{caption}
\usepackage{tabularx}
%\usepackage{adjustbox}
\usepackage[paper=a4paper,top=2cm,bottom=2cm,right=2.5cm,left=2.5cm,twoside ,bindingoffset=1cm,marginparwidth=0in,marginparsep=0in]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{indentfirst}
\usepackage[export]{adjustbox}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{enumitem}
\usepackage[titletoc]{appendix}
\usepackage{titlesec}
\usepackage{multirow}
\captionsetup[table]{position=above}
\usepackage{siunitx}
%\usepackage[stretch=10,shrink=10]{microtype}
\newcolumntype{C}{>{\centering\arraybackslash}m}
\sisetup{per-mode=symbol}
\usepackage{hhline}
\captionsetup[table]{position=above}
\setcounter{secnumdepth}{4}
\DeclareSIUnit{\year}{ano}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\usepackage{eurosym}
\usepackage{makeidx}
\usepackage{subcaption}
\usepackage{afterpage}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{placeins}
\usepackage{appendix}
%\usepackage{microtype}
\addto\captionsportuguese{
  \renewcommand\appendixname{Anexo}
  %\renewcommand\appendixpagename{Anexos}
}

%\usepackage{apalike}
%\usepackage{babelbib}


%\usepackage[square,authoryear]{natbib}

%\bibliographystyle{my-dinat}


\usepackage[natbibapa]{apacite}
\renewcommand{\BBAA}{e}
\setlength{\bibsep}{12pt}
\bibliographystyle{apacite}
\renewcommand{\doiprefix}{\ignorespaces}
\usepackage{doi}
\AtBeginDocument{\urlstyle{APACsame}}


\setcitestyle{square}

\graphicspath{{./figuras/}}
%\usepackage[natbib=true,style=authoryear]{biblatex}

%\addbibresource{projetobibf.bib}
%\usepackage{csquotes}

\setcitestyle{aysep={:}}
\setlength{\belowcaptionskip}{-2pt}

\setlist{itemsep=2.0pt}

\setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt}

\setlength{\floatsep}{5pt plus 1.0pt minus 2.0pt}
\setlength{\intextsep}{5pt plus 1.0pt minus 2.0pt}

\setlength{\parindent}{2.0em}
\setlength{\parskip}{0.5em}
%\renewcommand{\baselinestretch}{2.0}

\usepackage{fancyhdr}
\usepackage{lastpage}

\fancypagestyle{style1}{
\fancyhead{}
\fancyhead[LO,LE]{\nouppercase{\leftmark}}
\renewcommand{\headrulewidth}{0.4pt}
\fancyfoot{}

\fancyfoot[RO,LE]{\thepage}}

\fancypagestyle{plain}{%
  \fancyhf{}%
  \fancyfoot[RO,LE]{\thepage} %of \pageref{LastPage}}%
  \renewcommand{\headrulewidth}{0pt}}% Line at the header invisible
  %\renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible


%\fancypagestyle{style2}{
%\fancyhead{}
%\renewcommand{\headrulewidth}{0pt}
%\fancyfoot{}

%\fancyfoot[RO,LE]{\thepage}}

%\fancypagestyle{style3}{
%\fancyhead{}
%\renewcommand{\headrulewidth}{0pt}
%\fancyfoot{}

%\renewcommand{\footrulewidth}{0pt}}
%\setlength{\parindent}{0em}

\pdfinclusioncopyfonts=1
\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}
    
   

\newgeometry{top=2cm,bottom=2cm,right=2.5cm,left=2.5cm,bindingoffset=0cm,marginparwidth=0in,marginparsep=0in}
\title{Desenvolvimento de um edifício tipo "PassivHaus" para clima temperado (Português) integrando painéis "sandwich" estruturais e fontes de energia renováveis}
\author{Diogo Filipe Pereira Remoaldo}

\begin{document}

\begin{table}[!htbp]
	\centering
	\caption[Procedimentos de autentificação]{Procedimentos de autentificação. Adaptado de \citep{bio}}
	
	\begin{tabularx}{\textwidth}{|c|c|c|}
		\hline
		Procedimento de Autentificação & | Vantagens & | Desvantagens \\
		\hline
		\multirow{4}[0]{*}{Documentos de identificação (cartão de cidadão, passaporte)} & Pode ser sempre gerado um novo       &  Pode ser roubado\\ 
		& As pessoas como norma, podem usá-las como método de identificação em qualquer país      &  Pode ser falsificado ou duplicado\\ 
		&  &  Pode ser partilhado\\ 
		&       & Um utilizador pode-se registar com várias identidades  \\ \hline
		\multirow{4}[0]{*}{Identificação com base em conhecimentos (pin e palavra-passe)} & Baixo custo de implementação      & Pode ser advinhada ou quebrada  \\ 
		& Caso exista algum problema pode ser facilmente substituída por uma nova      &  Palavras-passe longas ou complicadas são difíceis de ser recordadas \\ 
		& & Podem ser distribuídas \\
		& & Um utilizador pode registar-se com diferentes identidades \\ \hline
		\multirow{3}[0]{*}{Parâmetros biométricos} & Não pode ser advinhado, roubado (facilmente), esquecido, perdido ou partilhado      & Caso haja algum problema (por exemplo pele oleosa no caso das impressões digitais), não é possível a sua substituição \\ 
		& Uma pessoa com várias identidades pode ser facilmente identificada  & É impossível de repôr se os dados biométricos de uma pessoa forem roubados \\
		& & É o método de autentificação mais seguro \\ \hline
	\end{tabularx}%
	\label{autentable}

\end{table}%
\vspace{4.0mm}

\end{document}
Attachments
wished table
wished table
tabela.png (37.68 KiB) Viewed 5989 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Table content not fitting in the page

Post by Stefan Kottwitz »

Hi Diogo!
  • Use X-columns, such as: \begin{tabularx}{\textwidth}{|X|X|X|}
  • Use = instead of * in the \multirow argument: \multirow{4}[0]{=}
Stefan
LaTeX.org admin
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

Table content not fitting in the page

Post by Diogo Remoaldo »

Stefan Kottwitz wrote:Hi Diogo!
  • Use X-columns, such as: \begin{tabularx}{\textwidth}{|X|X|X|}
  • Use = instead of * in the \multirow argument: \multirow{4}[0]{=}
Stefan

Thanks a lot, the results were even better than what I was expecting.

Best regards,

Diogo Remoaldo
Post Reply