The table produced by this code always goes out off the width of my page. I want the table to fit within the width of the page. I tried giving extra \\ in between but it made it worse only.  \begin{tabular}{|l|l|} \hline   LocationProvider &amp; Description \\   \hline   network &amp; Uses the mobile network or WI-Fi to determine the best location.Might have a higher precision in closed rooms than GPS. \\ \hline  gps &amp; Use the GPS receiver in the Android device to determine the best location via satellites. Usually better precision than network. \\ \hline  passive &amp; Allows to participate in location of updates of other components to save energy \\  \hline  \end{tabular}   The result:
1480
I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?
73595
After posting  to the query , I thought about how to generalize (and simplify) the OP's setting, e.g., by using explicit theorem-like environments in the two columns.   In the following MWE, which employs the tabularx and amsthm packages, things work fine. (The framelines in the screenshot indicate the edges of the text block.) In the first tabularx environment, the first column is narrower than the second, and in the second tabularx environment, the situation is reversed. In both environments, the filler text that makes up the body of the "theorems" occupies the full width of the cell:    \documentclass{article} \usepackage[a4paper,margin=2.5cm,showframe]{geometry} \usepackage{tabularx} \newcolumntype{L}[1]{&gt;{\hsize=#1\hsize}X} \usepackage{lipsum}  \usepackage{amsthm}  %\usepackage{ntheorem}  \newtheorem{theorem}{Theorem}  \begin{document} \noindent % First column is narrower than second: \begin{tabularx}{\textwidth}{@{} L{0.8} | L{1.2} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &amp;   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx}  \bigskip\noindent % Now, first column is wider: \begin{tabularx}{\textwidth}{@{} L{1.2} | L{0.8} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &amp;   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx} \end{document}     However, if I comment out the instruction \usepackage{amsthm} and activate the instruction \usepackage{ntheorem} in the preceding MWE (and leave everything else unchanged), I get a rather different result: In the first tabularx environment, the text in the right-hand cell does not occupy the available horizontal space; in the second tabularx environment, both columns now take up the same width even as the width of the text in both cells is restricted to that of the second column.  Question: Have I encountered a bug in either ntheorem or tabularx, or did I set up the mechanism for generating X columns of varying widths incorrectly?  Some background information: The issue occurs with both TeXLive2019 and the current pre-release version of TeXLive2020. I use tabularx 2020/01/15 v2.11c, amsthm 2017/10/31 v2.20.4, and ntheorem Version 1.33 &lt;2011/08/15&gt;. AFAICT, the issue appears to be independent of the choice of document class.
122554
I have a Twitter Bootstrap based table with responsive CSS. Everything looks good but, when I try to put more columns than the size of the table supports, I have a line breaking. I tried to change font size. But I think it would be strange or confusing for the user if I have different font sizes in each table. So I am in a dead end. Some restrictions  Maximum width: The table must not exceed 940 pixels. Single Table: I can't divide the information in multiple tables.  This is what I have:  Is there a better way to display tabular data considering the restrictions?
6564
threeparttablex can be used to add table notes to tabu tabulars*. If the tabular spans \textwidth, the output is as expected. It seems however that the tablenotes environment does not adjust its width if the tabular is narrow, although of course this would be desirable.  1) Is there any option/command which is intended to automatically adjust the tablenotes environment's width?  2) If not, is there a workaround?    @ 2) According to , threeparttablex does know the tabular's width. Moreover, given that for the threeparttable package, which threeparttablex supposedly builds upon, the package documentation states "you can redefine the whole tablenotes environment", it seems that it should be possible to find a workaround.  \documentclass{article} \usepackage{booktabs} \usepackage{tabu} \usepackage{threeparttablex}  \begin{document}     \centering \begin{ThreePartTable}     \begin{tabu} to .4\textwidth {XX}         a &amp; b   \\\toprule         0 &amp; 1   \\\bottomrule     \end{tabu}     \begin{tablenotes}         \footnotesize         \item[*] This is a long table note text, long enough to exceed the table's width.     \end{tablenotes} \end{ThreePartTable} \end{document}   *threeparttablex is designed to extend threeparttable to longtable. Even though the manual does not mention it, threeparttablex works with tabu, which threeparttable does not. Replacing threeparttablex's ThreePartTable environment in the above code with a threeparttable environment gives an "Extra }, or forgotten \endgroup." error.
77930
I currently have this table:  \begin{table} \centering \begin{tabular}{ |c|c| } \hline no test &amp; no test \\ \hline no test &amp; \begin{tabular}{c|c} D1 &amp; 1.23 \\ \hline D2 &amp; 1.23 \\ \end{tabular} \\ \hline \end{tabular} \end{table}    Giving:    hline in the nested tabular does not span the entire cell width.  Of course multirow/multicolumn would be a choice. However, this is a "mutable" table, to which I will need to add "sub-rows" each time new data arrives, but I do not know in advance where. So, it could become something like:    For such purpose, multirow/multicolumn seems that would require constantly changing their row/column numbers.  How can this be solved in such a way that minimizes the work each time a new "sub-row" is added?  Thanks.
92740
Consider the minimal code below, which produces two different layouts depending on the  table position marks.    The first layout uses   \begin{table}   which results in the table ending below the footnotes and the second,  \begin{table}[htbp]   results in the table ending above the footnotes. Is this normal behaviour in LaTeX? I think a better algorithm would have been to try and position images or tables above the footnotes; is it some form of a bug? Here is the MWE.  \documentclass{book} \usepackage[paperwidth=4.75in,paperheight=7.25in,             textwidth=4.5in,textheight=6.5in,             headsep=0.1in, footskip=0.15in,             marginratio=1:1]{geometry} \usepackage[latin,english]{babel} \usepackage[demo]{graphicx} \usepackage{booktabs,lipsum} \begin{document}  \selectlanguage{latin} \chapter{Errora}  Una imagine tabula, figura et \ae nigma.\footnote{translatio via google}.   \begin{figure}[htbp] \centering \includegraphics[width=0.3\textwidth]{./graphics/amato} \caption{Uno pictorum}  \end{figure} \begin{table}%[htbp] %uncomment to see difference \centering \begin{tabular}{cccc}   \toprule   Error &amp;Errors &amp;error &amp;errors\\   \bottomrule \end{tabular}       \caption{Test} \end{table} %\lipsum[1-3] \end{document}   Edit:  I had a look at the documentation of the footmisc recommended by Thorsten Donig as a workaround where  Robin Fairbairns describes this behaviour as an "infelicity". There is a further infelicity, if you let both floats to float freely, the table floats to the next page and the image goes in the footer area, while there is ample space to have stayed exactly in its position in the text.
44937
I have produced this table in LaTeX:     \begin{table}[hbt]                     \begin{center}                         \begin{tabular}{|l|l|l|l|}                             \hline &amp; \multicolumn{3}{c|}{Examples}\\                             \cline{2-4}                             &amp; description &amp; $M$ &amp; \textbf{u}\\                             \hline translation &amp; through vector $\begin{pmatrix}6\\7\end{pmatrix}$ &amp; $\begin{pmatrix}                                 1 &amp; 0 \\ 0 &amp; 1                             \end{pmatrix}$ &amp; $\begin{pmatrix}6\\7\end{pmatrix}$\\                             \hline reflection &amp; in line $x=2$ &amp; $\begin{pmatrix}                             -1 &amp; 0 \\ 0 &amp; 1                             \end{pmatrix}$ &amp; $\begin{pmatrix}4\\0\end{pmatrix}$\\                             \hline rotation &amp; about \textbf{0} through $\pi$ radians &amp; $\begin{pmatrix}                             -1 &amp; 0 \\ 0 &amp; -1                             \end{pmatrix}$ &amp; $\begin{pmatrix}0\\0\end{pmatrix}$\\                             \hline glide reflection &amp; in line $y=x$, then through $\begin{pmatrix}1\\1\end{pmatrix}$ &amp; $\begin{pmatrix}                             0 &amp; 1 \\ 1 &amp; 0                             \end{pmatrix}$ &amp; $\begin{pmatrix}1\\1\end{pmatrix}$\\                             \hline                             \end{tabular}                             \caption{Examples of Euclidean Transformations} \label{tab1}                     \end{center}                     \end{table}   How do I remove the two external lines from the top left empty corner cell? I want lines only around the other parts.  Also it looks a bit cramped, is there a way I can present it more nicely?
66310
I am doing a proof of concept with responsive design. One web page that I am modifying has some extremely wide tables. I really don't know how to shrink the tables width so there is no horizontal scroll bar in a mobile browser.  I was just wondering if anyone had the same issue with wide tables and what they did to overcome a horizontal scroll bar in a mobile browser using responsive design. Oh and I wanted to add that I can not hide columns in the table.
7462
The table that I'd like to make does not display fractions with enough space between lines. What's the reasoning for this? (Not enough rep to be able to post a picture yet unfortunately.)  \documentclass{article} \usepackage{amsmath,amsfonts} \usepackage{booktabs}  \begin{document} \begin{table} \centering \begin{tabular}{lcccc} \toprule \textbf{Care type} &amp; $\mathbb{P}(Pat \cap H)$ &amp; $\mathbb{P}(Pat \cap H')$ &amp; $\mathbb{P}(Pat' \cap H)$ &amp; $\mathbb{P}(Pat' \cap H')$\\ \midrule Direct care  &amp;$\displaystyle \dfrac{58}{197}$  &amp;  $\displaystyle \dfrac{48}{197}$  &amp; $\displaystyle \dfrac{21}{197}$* &amp;$1-\displaystyle \dfrac{58}{197}$ \\ Housekeeping &amp;$\displaystyle \dfrac{12}{17}$  &amp;  $\displaystyle \dfrac{2}{17}$  &amp; $\displaystyle \dfrac{5}{17}$* &amp;$1-\displaystyle \dfrac{12}{17}$\\ \bottomrule \end{tabular} \caption{Probabilities of hand hygiene given direct patient contact} \label{tab:handwash_given_pat} \end{table} \end{document}   Edit: Image added and MWE completed.
115509
Consider the following table example, the text in the second row is wrapped.  \documentclass[a4paper]{article}  \usepackage[english]{babel} \usepackage[utf8x]{inputenc} \usepackage{tabu} \usepackage{booktabs}  \usepackage{array} \setlength{\extrarowheight}{5pt}  \begin{document}    \begin{tabu} to \linewidth {X[.5,c] X[1,l] X[1,l] X[2,l]}     \toprule     \rowfont{\bfseries}     Row &amp; Head 1                   &amp; Head 2 &amp; Head 3 \\\hline     1.  &amp; short text               &amp; ? &amp; ? \\\hline     2.  &amp; long long long long text &amp; ? &amp; ? \\\hline     3.  &amp; short text               &amp; ? &amp; ? \\\hline     4.  &amp; short text               &amp; ? &amp; ? \\     \bottomrule   \end{tabu}  \end{document}   It renders like:    Why is there so little space between the text in the second row and the rule below it?  How can I fix it?  What comes to my mind is to use \\[1ex] instead of \\, is there a better solution?
84307
Consider the following screenshot.    The features I want to have are:   I can shrink the page size and the table is allowed to break across pages.  The background of odd rows must be different from that of the even rows to ease reading. The values must be calculated automatically rather than by hand-made data entry.    MWE  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage[nomessages]{fp} \usepackage[table]{xcolor} \usepackage{longtable} \usepackage{pgffor} \begin{document} \topskip=0pt \begin{longtable}{*2{|&gt;{$\displaystyle}c&lt;{$}}|}\hline \theta &amp; \sin \theta\\ \foreach \x in {0,10,...,360}{\x &amp; \FPeval\temp{round(\x:3)}\temp\\} \end{longtable} \end{document}
103030
My code follows:  \documentclass{book} \usepackage{color,colortbl} \begin{document}  \begin{tabular}{ll&gt;{\color{red}}p{20pc}} a &amp;1 &amp;Test \end{tabular}  \end{document}   The output was:    Some unnecessary vertical space came before the last column. If I remove the tag \color{red} then everything works fine, how can I fix this?  Above said issue was fixed based on the suggestion given by David Carlisle and CarLaTeX, but the same problem was there if I use the supertabular environment, I used supertabular package for auto breaking table and the code follows:  \documentclass{book} \usepackage{color,colortbl,supertabular} \begin{document}  \begin{supertabular}{ll&gt;{\leavevmode\color{red}}p{4pc}&gt;{\leavevmode\color{black}}l&gt;{\leavevmode\color{black}}l&gt;{\leavevmode\color{red}}p{4pc}} a &amp;1 &amp;Test &amp;a &amp;1 &amp;Test\\ a &amp;1 &amp;Test &amp;a &amp;1 &amp;Test\\ \end{supertabular}  \end{document}
119370
I have a tabular which relies on a number of packages to achieve the desired appearance, specifically:   Scale text to a particular (smaller) size Force column wrapping instead of shrinking text further Increase space between different rows to distinguish between wrapped items Disable right justification and hyphenation for a tidier look   I discovered that the table will end up needing to span multiple pages, but in this situation longtable is not a drop-in replacement for tabular and I am getting confused with the number of packages involved. How can I achieve the desired effect (a tabular spanning multiple pages, with all other visual elements, including the float caption, retained)? As a second question, can what I've written be simplified in some way?  \documentclass{scrartcl} \usepackage{booktabs,array,parskip,adjustbox,enumitem} \usepackage[UKenglish]{babel} \newcolumntype{x}[1]{&gt;{\raggedright}p{#1}} \begin{document}   \begin{table} \begin{hyphenrules}{nohyphenation} \renewcommand{\arraystretch}{1.5} \caption{Example table}\label{tab:example} \centering \begin{adjustbox}{width=1\textwidth} \begin{tabular}{x{.2\columnwidth}@{\hskip 6\tabcolsep}x{.4\columnwidth}@{\hskip 6\tabcolsep}x{.4\columnwidth}} \toprule {\textbf{Column One}} &amp; {\textbf{Column Two}} &amp; {\textbf{Column Three}} \tabularnewline \midrule  ABC &amp; \begin{itemize}[leftmargin=*] \item This is an item in column two. \item This is another item in column two. \end{itemize} &amp; \begin{itemize}[leftmargin=*] \item Here is something in column three:   \begin{itemize}   \item It   \item consists   \item of   \item many   \item different   \item lines   \end{itemize} \end{itemize} \tabularnewline  DEF &amp; \begin{itemize}[leftmargin=*] \item Additional blah blah making for a long sentence spanning multiple lines. \item Another item. \item Continuing the theme of items in column two. \end{itemize} &amp; \begin{itemize}[leftmargin=*] \item Here we also have a rather long item that needs multiple lines to fit. \item Yet another item. \item Blah, blah:   \begin{itemize}   \item It's a very long example of a sub-item in this column, here   \item Yet more   \end{itemize} \end{itemize}  \tabularnewline  GHI &amp; \begin{itemize}[leftmargin=*] \item Another long, long long long long long long long long long long long block of text. \item This particular one is medium-medium medium in lenght. \item This sentence means nothing in particular, it's blah. \end{itemize} &amp; \begin{itemize}[leftmargin=*] \item Blah \end{itemize}  \tabularnewline  JKL &amp; \begin{itemize}[leftmargin=*] \item Blah, blah, blah, blah, blah. \item Putting in fake data gets tedious. \item Reading it is probably more boring still. \end{itemize} &amp; \begin{itemize}[leftmargin=*] \item Blah \end{itemize} \tabularnewline  MNO &amp; \begin{itemize}[leftmargin=*] \item This was also a really long item so I am going to type and type and type until I run out of words. \end{itemize} &amp; \begin{itemize}[leftmargin=*] \item Blah \item Can \item we \item span \item multiple \item pages \item with \item lots \item of \item text? \item Becauase \item this \item really \item needs \item to \item be \item multipage. \end{itemize} \tabularnewline  \bottomrule \end{tabular} \end{adjustbox} \renewcommand{\arraystretch}{1} \end{hyphenrules} \end{table}  \end{document}
77160
I want to have my tables fill the entire width of the page (i.e., \textwidth). So far, the only thing I've managed to come up with is:  \renewcommand{\tabcolsep}{4.4pt}   By manually trying different values, I can eventually get the table to spread out and fill the space. However, this is tedious as I have a lot of tables.  I tried the tabularx package:  \begin{tabularx}{\columnwidth}{ r r r r r r r } \toprule &amp; $z_{6}$ &amp; $z_{8}$ &amp; $z_{9}$ &amp; $z_{11}$ &amp; $z_{13}$ &amp; $z_{14}$ \\ \midrule fileA &amp; 0.00 &amp; 0.00 &amp; 0.00 &amp; 0.08 &amp; 0.79 &amp; 0.08  \\ fileB &amp; 0.01 &amp; 0.00 &amp; 0.13 &amp; 0.00 &amp; 0.84 &amp; 0.00  \\ fileC &amp; 0.00 &amp; 0.39 &amp; 0.02 &amp; 0.49 &amp; 0.00 &amp; 0.00  \\ fileD &amp; 0.75 &amp; 0.08 &amp; 0.00 &amp; 0.00 &amp; 0.00 &amp; 0.00  \\ \bottomrule                              \end{tabularx}   However, this still relies on the \tabcolsep value. (If the value is small, all the columns will still be close; if it's large, the columns will be more spread out.) What I'm looking for is an automatic solution for two things:   the table to take the entire width of the page; and each column to be evenly spaced along the horizontal.   tabularx only does (1). How can I get (2)?
73905
I have a table in which I use \numrange of the siunitx package.  I would like to center align that column at the range-phrase. If I align it left, it sort of works, but if I align it center, it is not good enough. How can I solve this?    \documentclass{book} \usepackage[T1]{fontenc} \usepackage{siunitx}    \begin{document} \begin{table} \caption{All measured and their estimated outcome variables during 30 minutes of chair exercises} \label{table:outcomes} \sisetup{ range-phrase = -- }  \begin{tabular}{                 l                 c                 c                 c                 %S[parse-numbers = false,input-decimal-markers={-},output-decimal-marker = \text{--}]                 S[table-format=3.1, table-text-alignment=center]                 }  \multicolumn{1}{l}{}&amp; \multicolumn{1}{c}{Mean}&amp; \multicolumn{1}{c}{SD}&amp; \multicolumn{1}{c}{Median}&amp; \multicolumn{1}{c}{Range}\ \hline   \%vo2max (mL/min) &amp; 66.0 &amp; 16.5 &amp; 66.9 &amp; \numrange{30.3}{115.8}\\    &amp;&amp;&amp; 54.6 &amp; \numrange{30.3}{77.7}\\   &amp;&amp;&amp; 69.9 &amp; \numrange{43.8}{115.8} \   \hline     \end{tabular} \end{table}  \end{document}
11517
I want a table that is as wide as the whole page in a document with option twocolumn. The table has to be inserted on the bottom of the page, but that is not necessary.  I've tried:  \begin{table*}[b]   ... \end{table*}   But that puts the table at the end of the document instead of on the same page.  I also tried:  \twocolumn[   \begin{table}[b]     ...   \end{table} ]   But that gives me an error: ! Argument of \@xfloat has an extra }. Combining \twocolumn and the star mark gives the same error.  What's the right way to do this?
32055
I want to use the longtable environment for a table. However, I do not know how to place it at the top of the next page, as I can do with the table environment. Do you know how to do it?