{tables} is about the tabular environment and related packages such as {array}, {booktabs}, {tabularx}, {tabu} and {longtable}. For questions about the table environment (i.e., about floating or positioning), use {floats} instead.

learn more… | top users | synonyms (2)

6
votes
1answer
2k views

Multiple references to the same footnote inside a table environment

I followed the steps in this answer to get multiple references to the same footnotes working. As shown in this minimal example, the solution is working great for footnotes in the text, also getting ...
12
votes
2answers
2k views

Misplaced \omit. \multispan with \newcommand

I'm trying to build my own cookbook-style, which has an ingredient makro. Sometimes the ingredients should be seperated and have a headline, so I tryed with an optional argument. A minumum example ...
11
votes
1answer
296 views

Error with table

\begin{table}[ht] \makebox[\textwidth][c]{ \begin{tabular}{ccccc} \hline \hline [] & [] & [] & [] & []\\ [] & [] & [] & [] & []\\ ...
11
votes
2answers
2k 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 ...
9
votes
5answers
901 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 ...
10
votes
6answers
869 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{|||} ...
42
votes
3answers
43k views

Adding space between columns in a table

I notice that the space between each column of a table in LaTeX is not quite wide (at least for me). Is there any way to set this? I found the \hspace, but I don't get how to use this in the table. ...
30
votes
3answers
37k views

How can I draw a horizontal line spanning only some of the table cells?

In a table, how can I draw a horizontal line that goes only through some of the cells? I mean a line like the one in the Foo and in the Bar area of this table: +----+-----+ |Foo |1 |2 | | |1 |2 | ...
12
votes
1answer
2k views

How to draw lines around multiple table cells

\documentclass[fleqn,12pt,a4paper]{article} \usepackage{tabularx} \begin{document} \begin{table}[ht] \begin{minipage}[b]{1 \linewidth}\centering \begin{tabular}{|c|c|c|c|c|} \hline ...
33
votes
3answers
47k views

Is there a way to slightly shrink a table, including font size, to fit within the column boundaries?

I have a table that is just a little too wide for a 3.33" column. Is there a way to simply shrink the table a little to make it fit? I'm OK if the 10pt font becomes 9pt-something. Here is an example. ...
29
votes
1answer
23k views

How do I fill table cells with a background color?

I'd like to fill the cells of a table with a background color. How can this be done?
21
votes
2answers
41k views

How do I color table columns and rows?

I've found question How do I fill table cells with a background color?, but the link to the documentation isn't helping me at all. I'd like to know how to color a table column given my column code, ...
22
votes
4answers
6k views

Rotated column titles in tabular

I'd like to create a chart where the column titles are rotated, as per this toy example: I used the rotating package to generate the above. It has certain shortcomings: the rotate command doesn't ...
20
votes
2answers
25k views

How to force table caption on top?

I have a table which works ok...as per example below. But in the thesis, the right column is centered and caption forced to below table. Is there a way I can make it look like? ...
11
votes
3answers
5k views

Convert numpy array into tabular

I am doing some data analysis in python, putting the results in form of a matrix stored into a numpy array. I would like to put this results into a report and the best way would be to put a table with ...
33
votes
5answers
60k views

LaTeX tables: How do I make bold horizontal lines (typically \hline)?

The title says it all: In LaTeX tables: How do I make bold horizontal lines (typically \hline)?
27
votes
2answers
3k views

Insert libreoffice table as input

This question led to a new package: odsfile Suppose you have an localc spreadsheet myspread.ods and you want to insert the content of the range H4:I40 as a table into your latex document. I ...
17
votes
2answers
2k views

How to make longtable respect \nopagebreak in the beginning?

For the book I am typesetting now I need a table environment with the following abilities: Span over multiple pages; Allow \nopagebreak between two lines Do not ignore \nopagebreak before the ...
13
votes
2answers
11k views

Making a long table continue over two columns

I am using multicol to make a two-column document using the book document class. I have a long tabular that I want to break where the page breaks and then continue in the next column. I could split ...
10
votes
2answers
779 views

pgfplotstable or datatool?

What are differences, which to use for including .csv, .tsv files ? Datatool ? pgfplotstable ? I've seen at question : How typeset a numeric table from a CSV file how person asked about fixing ...
13
votes
2answers
15k 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?: ...
12
votes
1answer
802 views

Scientific Notation Only For Large Numbers

I have a table full of numbers. Most of them are floating point numbers that are less than one, some are integers from 1-100, and a few are large (×10^75). I know how to set the precision of the ...
5
votes
5answers
9k views

Centering mutirow text in a table whose cells contain several lines of text

I'd appreciate advise in centering a multirow text. In the MWE below the multirow text "spring" is NOT centered over the three rows that it spans. ...
14
votes
3answers
5k 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}
11
votes
2answers
3k views

Color entire table

How do I get an entire table to get a background color. I dont mean the indivual cells but the entire table to get a gray shade. Something like this:
11
votes
3answers
8k views

Tabular with p type columns to fill page width

I wish to be able to have a table (using tabular) that fills the page horizontally with each column using a fraction of that space, for now assume that they are equally sized. I wish to be able to ...
11
votes
6answers
3k views

Generate LaTeX Truth Table with Python Cheetah

While looking for code which can automatically generate truth table in LaTeX I stumbled on this Python generator. It appears that the code can be used from Cheetah's framework. Can anybody point me to ...
10
votes
1answer
690 views

Add a curved arrow and a bracket to a table

I'm a beginner to LaTeX. I want to add a curved arrow pointing from one row to another. And I also want to add a { on the other side of the table to mark several rows. \begin{center} ...
8
votes
1answer
680 views

tabular bibliography with biblatex

I’m working on a custom biblatex style as I have to meet very special requirements. The citation part (cbx) works really well, but I have a problem with the bibliography definition. I need a tabular ...
5
votes
1answer
396 views

Color changes cell height in tabular

The following code shows that a \color{red} command increases the height of a tabular cell. I want to use a switch, not a command as \textcolor{red}{text}. \documentclass{article} ...
8
votes
2answers
2k views

colortbl: \rowcolor in tables with \begin{tabular}{@{}ccc@{}}

I'm trying to make a table with the following code: \begin{tabular}{@{}ccc@{}} \hline \rowcolor[gray]{.9} a & b & c \\ \hline \end{tabular} Unfortunately the \rowcolor command seems ...
7
votes
2answers
15k views

itemize in a tabular environment

When compiling this: \begin{table*}[h] \begin{tabular}{|lll|} \hline \bfseries Name & \bfseries Opt 1 & \bfseries Opt 2 \\\hline \hline \bfseries Item 1 & X & ...
6
votes
1answer
85 views

Unwanted padding in tabular columns when cells contain multiple rows

Whenever I need to create a cell with multiple rows in a tabular environment, I usually create enclose the contents of the cell within a tabular environment within the cell. This has been a great fix ...
6
votes
1answer
2k 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
1answer
752 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 ...
4
votes
1answer
966 views

Caption at foot of long tables ('longtable' package)

I would like to ask a question about longtable package. I've already posted it in other forums. I have a long table (a several-pages-long one) using longtable package and I would like to add a table ...
4
votes
2answers
415 views

An improved \rowstyle that takes the cell contents as an argument

It is possible to format the column entries of a tabular in an argument-style fashion using the lrbox environment to store the column cell in a box (say) \mybox; and supply \mybox as an argument to ...
1
vote
1answer
1k views

bottomrule not working in a self-made environment

I have this environment for consistent tables in my LaTeX documents: \newenvironment{defaultTable}[2] { \@float{table}[h] \noindent \tabularx{\textwidth}{#1} \specialrule{0.5pt}{10pt}{0pt} ...
0
votes
1answer
542 views

How to make table with divided column [duplicate]

Possible Duplicate: How to merge columns in a table? How can I make a table of the type above? I am writing a seminar report using the report class.
10
votes
3answers
453 views

Move tabular entry to bottom of row

How do I get the last column text to be at the bottom of the row? That is I want the XXX to be aligned with the line containing the arrow. I tried playing around with \multirow{3}{-3ex}{XXX}, but ...
10
votes
2answers
2k views

Table column widths disproportionate due to multicolumn cell being too long

I'm trying to typeset a table that would have a header in the first row (I'm not looking for a different/better solution to adding a header, but for a fix to this solution. Thanks). I want to achieve ...
8
votes
3answers
4k views

Set multicolumn width to default table width

I have a two column table with a single multicolumn spanning both of them. The text on that multicolumn is rather long so I need to set its width so it wraps around. I can set the width with ...
8
votes
1answer
1k views

siunitx: Bold single numeric cells

I'm struggling to make a single numeric cell in an siunitx table bold. (A similar question for making a whole column bold is available here.) I want to define a simple macro which I can set for the ...
8
votes
1answer
437 views

Custom macro for multicolumn with & without xparse

The following example has two normal LaTeX \newcommand macros and two xparse \NewDocumentCommand for specifying multicolumn text. The only difference between each pair of commands is one has the ...
8
votes
2answers
3k 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
3answers
4k views

Relative column width in LaTeX

How can I define a tabular with two columns in LaTeX, where the first column fills 30% of the page width and the second column fills the rest?
5
votes
3answers
224 views

Creating a special table with different row lengths in latex

How can I have a table like the following picture in latex?
2
votes
2answers
261 views

Creating a table in LaTex with the following style

I'm new to LaTex, and would like to create a table that looks as follows: How can this be done in LaTex? Thanks.
2
votes
2answers
2k views

How to make a table smaller?

I am going make a table smaller in a paper which I am going to submit to a journal. I used \small but it does not make it small enough ?
21
votes
4answers
1k views

How to draw arrows from cell to cell at the borders of a table

How can I draw arrows from cell to cell at the borders of a table? More precisely I'd like to get something like this: It would be nice to have a solution using TikZ. Edit: Since I have other ...