{tables} is about the tabular environment and related packages such as {array}, {booktabs}, {tabularx} and {longtable}. For questions about the table environment (i.e., about floating or positioning), use {floats} instead.
8
votes
2answers
1k views
Cannot use \toprule when doing \input inside tabular — why?
Using \input inside a tabular environment does not seem to work in all cases, but I don't see why.
The MWE below gives the following error message:
! Misplaced \noalign.
\toprule ->\noalign
...
8
votes
3answers
357 views
problem with using loop inside the tabular environment
I am having trouble with using a loop inside a tabular environment:
\newcounter{it}
\setcounter{it}{0}
\begin{tabular}{ll}
\loop\ifnum\theit<4
\addtocounter{it}{1}
Q & A\\
\repeat
...
8
votes
3answers
235 views
Inserting an image properly in a table
I'd like to insert those lines that from "Foo" point to the four different rows in the table.
I've tries inserting an image but it doesn't come out right (please ignore the bad quality of the ...
8
votes
1answer
591 views
Create a vertical line in a table that spans a range of rows but not all rows
I'm interested in methods to create a vertical line in a table that spans a range of rows but not all rows. I've found one solution below, but is there another solution such as \cline which allows ...
7
votes
1answer
904 views
Table typesetting with pgfplotstable
I have two questions concerning pgfplotstable and number formatting with pgf.
Consider the following piece of code:
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{amsmath}
...
6
votes
3answers
149 views
Centering in tabularx and X columns
How can I center the column when using X in tabularx environment like in this example?
\begin{tabularx}{\textwidth}{@{}lXXXXX@{}}
1 & 2 & 3 & 4 & 5 \\
\end{tabularx}
6
votes
2answers
284 views
latex tabular issue
I am creating a tabular in LaTeX.
I want one column to be as small as possible, with no inter column spacing, so that it's just enough to fit the text. I know the answer to this question: I need to ...
6
votes
3answers
5k views
Newline in a table cell which is centered
This question may look like a duplicate but, none of the answers given to the possible duplicates contain the answer to this specific case.
I have a tabular, say \begin{tabular}{ccc}. While adding a ...
5
votes
1answer
660 views
threeparttablex table notes for tabu tabulars with less than \textwidth
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 ...
5
votes
2answers
168 views
Customize the “cell environment” in a tabular
Is there a way to modify the layout of cells in a tabular?
I would like to have a environment mytable which I would use like a tabular:
\begin{mytable}{l|l}
entry & entry \\
entry & entry
...
5
votes
3answers
508 views
siunitx: how can I avoid adding decimal zeroes?
How can I format a table column with siunitxwithout adding additional zeroes after the decimal separator?
I'd like to see 5,2 in the output instead of 5,200 (however: 0,246 shall still be displayed ...
5
votes
3answers
9k views
how to vertically align a cell in a table?
I have a table that I define
\begin{tabular}{lllllllllllll}
\includegraphics[width=7.3in]{img1.pdf} &
\includegraphics[width=7.3in]{img2.pdf} &
\includegraphics[width=7.3in]{img3.pdf} &
...
5
votes
1answer
3k views
Color running over text in multirow column
I have a simple table with 2 multirow cells. However when I apply background color, it covers
the lower portion of the multirow cells and cuts through the middle of my text entry which is obviously ...
5
votes
1answer
860 views
floatrow: Changing the formatting of table footnotes
The floatrow package, which is useful for customizing the layout of floats, also allows to add footnotes as well as additional explanations (besides the caption) to tables. (The main commands are ...
4
votes
2answers
221 views
How to represent this data as a table?
I am trying to put this in a table inside my LaTeX document. How can I get this? Ctrl-K does it here but not sure how to do it in LaTeX.
Left Right Bottom Top ...
4
votes
1answer
247 views
Workflow for creating/updating tables?
I primarily a Word user, but use LaTeX now and then.
One thing I don't like working with in LaTeX is tables. My data might come from Excel (usually), Word, or the output of some custom program.
If my ...
4
votes
2answers
790 views
Wider tables in LaTeX, which is the best solution?
Hi I have a LaTeX table code generated from R like the following
\usepackage{rotating}
...
\begin{sidewaystable}
\begin{center}
\small\addtolength{\tabcolsep}{-7pt}
...
4
votes
1answer
3k views
How to Label and Caption a Tikzpicture inside a tabular environment
What is the correct way to label and captionize a tkizpicture inside a tabular environment? (Since figures are not allowed inside a tabular)
Excerpt from my .tex:
\begin{tabular}{l r}
&
...
3
votes
1answer
677 views
Regression tables made with esttab in Stata have columns with different widths, using LyX
I am relatively new to LyX and I am trying to output regression results into TeX code, and then insert the resulting tables in a LyX document.
The command I use to create the table is:
reg y1 x1, ...
3
votes
1answer
404 views
Page breaks in table rows
I want to make a document that contains a synopsis of events, like
YEAR HISTORY CULTURE SCIENCE
1770 History para- culture para- science para-
...
3
votes
1answer
376 views
How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule?
I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table. However, when \arrayrulecolor is used with \cmidrule, some odd ...
2
votes
2answers
219 views
table too wide for twocolumn-mode document
I have a table which comes outside the text column width into the margin of the paper. How do I make the text in the table align to left ?
\documentclass[a4paper,10pt]{article}
...
9
votes
2answers
663 views
Aligning inside tabular environment, specific cell
I'm trying to align specific content of the single cell.
For example,
\begin{tabular}{|r|r|}
\hline
1 & 2
\hline
right & to_the_left
\hline
1 & 2
\hline
...
9
votes
3answers
349 views
Define a table one column at a time instead of one row at a time
Is there a way to define a table like so?
\begin{tabular}{|c|c|}
column 1, row 1 \\
column 1, row 2 \\
column 1, row 3 \\
column 1, row 4 \\
column 1, row 5 \\ &&
...
9
votes
6answers
566 views
How do I expand a macro into a tabular head?
I would like to be able to define a macro that can be used in the tabular definition. How can I do this?
This does not work:
\documentclass{article}
\begin{document}
\gdef\buildtabularhead{|||}
...
8
votes
1answer
217 views
How to place all floats (tables in particular) at a certain point in the document
I would like to place all of the tables in the document at the end but before the bibliography generated by biblatex and the notes printed by endnotes.
In other words, I'd like to collect the tables ...
8
votes
2answers
226 views
How to check if a column type is defined?
Column types for tables can be defined and overwritten with \newcolumntype.
I would like to know if a column type is already defined for an example which shall only be executed in the case where the ...
8
votes
2answers
1k views
siunitx: aligning numbers by decimal points in tables doesn't work for bolded or italicized numbers
This is a follow-up question for Aligning numbers by decimal points in table columns.
User lockstep provided this solution:
\usepackage{siunitx}
\begin{document}
\begin{tabular}{S[table-format=3.2]}
...
7
votes
1answer
722 views
Tables with math, equal column width, and right alignment
Q: Is there an approach, less hacky than my \MyLen approach, that would generate roughly the second table below? I'd like to maintain professional features (but I welcome criticisms wholeheartedly!) ...
7
votes
2answers
5k views
Text wrap in tables (multirow package loaded)
I searched a bit, but I could not find a reliable way to wrap text in tables with columns spanning more than one row. Any ideas on how to fit this table in the page?:
...
7
votes
1answer
2k views
How to divide a table row into several columns?
I have a table with two columns. In the first column there is no multiple column. But there are 11 multiple columns in the second column. The format looks like:
| A | B ...
6
votes
3answers
437 views
How can I achieve proper vertical spacing for long blocks of text within a \multirow?
I'm trying to work with a table of the form:
\begin{tabular}[]{l D{.}{.}{-1}}
\multirow{2}{1in}{Here is a ton of text that is not going
to fit in one single line in this 1 inch column.} ...
5
votes
1answer
227 views
Adjust vertical spacing in tabular containing \href
I seem to be stumped by what seems like a basic tabular spacing issue (when an \href is used). The obvious solution of tweaking arraystretch does not seem to work.
What I want is that the output of ...
5
votes
1answer
250 views
Swallowed space after \tnote
I'm using threeparttable to add table notes to a tabu tabular*. A common use case is to have a note at the end of a cell. If the note is however not added to a cell's last word, the following space is ...
5
votes
1answer
486 views
Prevent xtab breaking table too soon
Xtab breaks a long table spanning multiple pages too soon -- see my screenshot:
The output seems rather unsightly to me. Can I make it take more of the available space?
Alternatively, is there a ...
5
votes
2answers
1k views
Combined header cell in a table
This question is closely related to at least two other ones; namely, Tables of numbers, and slashbox alternative.
What I'm after, is the horizontal- and vertical-alignment of row- and column-headers ...
5
votes
2answers
893 views
Color merged and regular cells in a table individually
In a LaTeX table with merged cells, how can I color each cell with a different color?
%% LyX 1.6.7 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know ...
4
votes
3answers
1k views
Text alignment on top with multirow command
\begin{table}[!h]
\centering
\caption{Titel}
\resizebox{.95\columnwidth}{!}{%
\begin{tabular}{p{4.5cm}p{10cm}p{3.5cm}}
\hline
Name & ...
4
votes
2answers
143 views
divide table cells by a certain amount
I made a mistake in the values that i put in the table. I need to divide all the values by 105. Is there a method where i can do it without having to replace this with a completely new table ?
% ...
4
votes
1answer
519 views
Ltablex customize caption
I use ltablex package for creating tables.
How can i change the caption name for the continuation of the table, as in the picture?
4
votes
2answers
864 views
\parbox “textwidth” for the combined width of a subset of table cells
I would like the parbox width of the text in a multicolumn to be calculated automatically from the combined width of the cells that the multicolumn spans. (Their width will vary in different copies of ...
3
votes
2answers
154 views
Align (center) header row in table
I use @{\hskip 50pt} to separate columns in my table. The problem which arises is that I add this extra space after a multicolumn. This also moves the header row so that it is no longer centred. Is ...
3
votes
1answer
107 views
I want to create graph with nodes as in the image:
I wrote an example graph with \xymatrix - that's OK. I added circles with &*+[Fo], that's OK too. I added table inside first circle with \begin{tabular} - it is OK. But table needs to be rotated ...
3
votes
2answers
364 views
Problems with \toprule and \midrule in a table
Having the following siunitx table code in LyX, for each occurrence of \toprule and \midrule I obtain an error message:
The control sequence at the end of the top line of your error message
was ...
3
votes
1answer
212 views
Adobe Reader and xcolor within a table breaks the line render
I'm using the xcolor package to colour the top row in a table. This is displayed properly using PDF viewers such as Preview or Skim (Mac). But using Adobe Reader 10.1.3 (either Windows or Mac) doesn't ...
3
votes
1answer
477 views
space between columns titles in tabular
I am having trouble doing the following in the tabular environment:
title1 title2
------ ------
a 1
b 2
. .
. .
. .
z 26
That, having only the column ...
3
votes
2answers
142 views
Table environment that can break inside a cell
I am wondering if there is an environment for creating a table in LaTeX that will not only break at \hline, but instead can break in the middle of a cell.
I have to write very long reports in one ...
2
votes
1answer
122 views
Dec sep align & \multicolumn incompatibility?
As I did not get any answer, I decided to split the two question so that they appear less daunting.
The initial question I am referring to is this one
Here is a table with regular alignment mixed ...
2
votes
2answers
336 views
Multirow tabular: un-indent the first line
In pdfLaTeX, tabular environment, the first line of each \multirow cell is indented. No matter if I use l, r or p for column specifier. How to get rid of that?!?
Here is the screenshot:
Here is ...
2
votes
1answer
151 views
longtable - strange lines at the end of table
I have strange problem with longtable package. Almost all my tables looks great but some of have strange lines at the end of tables. Please take a look at the picture
I create the table like that
...