{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.

learn more… | top users | synonyms (2)

229
votes
17answers
150k views

How to add a forced line break inside a table cell

I have some text in a table and I want to add a forced line break. I want to insert a forced line break without having to specify the column width, i.e. something like the following: ...
106
votes
24answers
13k views

Comprehensive list of tools that simplify the generation of LaTeX tables

Manually hacking tables in LaTeX is one of the less funny things when preparing a document. Naturally, there are quite a few tools that promise to simplify this. In fact, I have somewhat lost track of ...
106
votes
9answers
25k views

Beautiful table samples

I'm interested in learning about some nice-looking table samples. Colors can make a huge difference, and just providing some color to headers, background, or borders can dramatically change ...
76
votes
6answers
75k views

Column and row padding in tables

How do you guys go about controlling column padding in tables? Update To clarify, I'm looking for a way to control both vertical and horizontal padding. So, if I had a simple table like in the ...
72
votes
2answers
8k views

Which tabular packages do which tasks and which packages conflict?

I've read a couple of questions recently about tabular environments, and it seems there's a whole bunch of packages that do stuff in this field. I'd really like a summary of what each package does, ...
66
votes
2answers
94k views

How to create fixed width table columns with text raggedright/centered/raggedleft?

I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that \usepackage{array} ...
55
votes
4answers
21k views

Why should a table caption be placed above the table?

In the papers I read the caption in figure floats is placed below the figure and in table floats the caption is placed above the table. I recognize that this is a common style that a lot of people ...
51
votes
3answers
84k views

How to force a table into page width?

I have the following table: \begin{table}[htb] \begin{tikzpicture} \node (table) [inner sep=0pt] { \begin{tabular}{ l | l } {\bf Symptom} & {\bf Metric} \\ \hline Class that has many accessor ...
50
votes
3answers
3k views

Easiest way to delete a column?

I have a set of 10 tables and each has an extra column that I don't want. Specifically, these tables are descriptions of database tables exported by phpMyAdmin, and they all have a "MIME" column that ...
50
votes
2answers
14k views

Aligning numbers by decimal points in table columns

Let me begin by stating that I did google the answers (and I'll reference to them soon). Yet each of the resources I found discussed one particular method, I'm interested in a comparison of the ...
49
votes
4answers
55k views

How can I have two tables side by side?

Suppose I have two tables that don't have many columns (3, for example). How can I position them side by side?
46
votes
3answers
2k views

Is there a tool to make a complicated Table like this one (“Auswahlliste” from “Pahl/Beitz Konstruktionsmethodik”)?

I’m developing a product as a part of my thesis for my university in Germany. We are supposed to use standard methodology for decision making. One of the tools is called “Auswahlliste”. (I don’t even ...
46
votes
2answers
56k views

Changing the font size in a table

What's the recommend way of changing the font size in a particular table? Is there a better way than enclosing all values with, for example, the \tiny function.
46
votes
2answers
7k views

Org-mode export to LaTeX: temptation or nuisance?

We are talking about Emacs and Org-mode: There are several advantages of drafting papers with Org-mode and to have them transferred later to LaTeX, e.g.: I'd like to avoid »programming while ...
45
votes
3answers
13k views

How to create alternating rows in a table?

Sometimes you can see in books tables, that have alternating background color for rows in a table to support readability. How I can achieve this with LaTeX? And yes, I could put macros \odd and \even ...
42
votes
3answers
41k 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. ...
42
votes
5answers
45k views

How to break a line in a table [duplicate]

Possible Duplicate: How to add a forced line break inside a table cell In a table I would like to have a line break in the text inside a cell. Is there an easy way to do so, or do I have to ...
42
votes
4answers
18k views

Make first row of table all bold

I'm trying to do something that I thought would be relatively simple but seems to be quite hard. I have a table with a number of columns, and I'd like to make all of the titles appear in bold text. ...
42
votes
3answers
62k views

How to vertically-center the text of the cells?

I have a simple table as follows: \begin{table*} \centering \begin{tabular}{|l|c|c|c|c|p{2in}|} ... ... \end{tabular} \caption{The factors the camera solver depends on to ...
40
votes
1answer
4k views

booktabs: What is the difference between \toprule and \hline

The horizontal lines in tabular environment can be constructed. What is the difference between \toprule, \midrule, \bottomrule and specifying horizontal line using \hline?
39
votes
1answer
993 views

Table in the shape of an arrow

Is it possible (and not too difficult) to draw a table in the shape of an arrow? I think it's best explained giving an example: I'd like to draw a table almost exactly like this. However, the 2nd, ...
38
votes
6answers
7k views

Best way to create an system of equations environment?

I am trying to write a few systems of equations, and I want the terms to be nicely spaced as below 2x + y + 3z = 10 \\ x + y + z = 6 \\ x + 3y + 2z = 13 Now, using ...
38
votes
5answers
48k views

How to rotate a table?

I have a table and I want to rotate it. The table has 3 rows and 4 columns, and I want to rotate the text inside this table as well. How can I do this?
38
votes
1answer
30k views

How to add extra spaces between rows in tabular environment?

I couldn't find any option that lets me expand the vertical space between rows in tabular environment. For example, \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\ ...
37
votes
2answers
51k views

color only a cell of a table [duplicate]

Possible Duplicate: Color merged and regular cells in a table individually I tried to color only a cell of my table but I don't know how do it. I found the method to color an entire row.How ...
36
votes
6answers
8k views

Footnotes in tables?

I would like to have footnotes in tables, but the \footnote command does not work inside a table environment. Googling one finds that this is a frequently asked question, at least in the UK. That ...
35
votes
2answers
1k views

Partially coloring cell background to fake histogram

Excel has a cool feature called "data bar" conditional formatting that allows the user to partially fill a cell background to create histograms based on cell contents. Here is a screen clip example ...
34
votes
5answers
11k views

How can I automatically calculate sums in a LaTeX table?

Sometimes I would like LaTeX to automatically calculate sums (or other simple arithmetic) for me, eg. in a table. I would like to ensure that when I update the table, I don't accidentally forget to ...
33
votes
2answers
18k views

How can I reproduce this table with thick lines?

I'm trying to reproduce this table: (apologies for the terrible cameraphone pic) I don't know how to get the slightly thicker leftmost and topmost line. Here's a minimal example of what I have so ...
32
votes
3answers
12k views

Why not use vertical lines ('|') in a tabular?

My question is a follow-up to the answer to a follow-up question, to be found here. ;) I'd like to know why one would advise against using vertical lines (via |) in a tabular (i.e. in ...
32
votes
5answers
58k 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)?
32
votes
2answers
63k views

How to specify the row height in LaTeX table?

I want to create a LaTeX table with three rows which have different row heights. How can I do this? The following code \renewcommand\arraystretch{2.4} \setlength\minrowclearance{2.4pt} seems make ...
31
votes
3answers
45k 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. ...
31
votes
2answers
7k views

How to diagonally divide a table cell … properly?

There have been many threads discussing solutions to the task of drawing a diagonal line in a table cell. There are also two packages to do this, slashbox and the better looking makecell with its ...
30
votes
10answers
3k views

Methods to edit column order in an existing LaTeX table?

What is the best way of editing an existing LaTeX table? I need to swap the order of two columns and can't think of an efficient way of doing this. My table is a long creature of the following ...
30
votes
3answers
35k 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 | ...
30
votes
2answers
22k views

Center column with specifying width in table (tabular enviroment)? [duplicate]

I have table that has long headers and I would like to specify width of the column, but also be able to remain it's centred position. Something like |c{0.30\textwidth}|. It is possible? How to ...
30
votes
2answers
4k views

multicolumn long table or enumeration

I would like to generate a multi-column table that wraps within columns of the document, and splits across pages. There are a couple of similar questions here How do I create a really long table in ...
29
votes
4answers
119k views

Tabular: title above and caption below?

I have a table that I would like to put the Title above and a caption below. Intuitively (though I know how troublesome intuition can be in something like LaTeX), I should be able to do as below: ...
29
votes
3answers
5k views

How can I make a table that takes up more than a single page?

I've got data that I need to include in a table, but there's a lot if it. I've played with the font size and table formatting as much as I can, but the table still won't fit on the page. Is there ...
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?
28
votes
5answers
2k views

How to produce a list of prime numbers in LaTeX

I would like to write a LaTeX script that produces all the prime numbers between the numbers n and m, where n < m. How can I do this? I feel it shoud not be that hard, but I cannot seem to program ...
28
votes
3answers
8k views

Professional-looking tables with alternating row colors?

Both the Booktabs documentation and the Small Guide to Making Nice Tables provide some nice rules-of-thumb for making professional-looking tables (e.g., no double rules, no vertical rules, etc.) Q: ...
28
votes
2answers
8k views

How to repeat top rows (column headings) on every page

I have a big table which contains hundreds of rows. I want to repeat the top two rows on every page of the table. How can I do it in TeX?
28
votes
3answers
11k views

Diagonal lines in table cell

I need this table: (each row and column should have the same height and length, last cell should be divided by diagonal line). I tried the following code: \documentclass[11pt]{article} ...
27
votes
1answer
21k views

Can a table include a horizontal dashed line?

In a normal table, you can use the \hline command to draw a horizontal line. I am trying to make this line a dashed horizontal line. I have found the package dashrule via this answer, but this only ...
27
votes
2answers
2k 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 ...
26
votes
2answers
22k views

Vertically center cells of a table?

What is the easiest way to center align each row of table? I have a table column that contains an image and other cells in the same row contain text. I would like to know how to vertically center ...
26
votes
2answers
39k views

How to merge columns in a table?

I have this table, but wanted to format the first row. I like to match the two columns of first row, and last two columns of the same first row. Any suggestion on how to do that? \begin{table}[!h] ...
26
votes
3answers
2k views

Parametrize shading in table through TikZ

I wanted to do some shading in a table according to its values. For example, if you see the table below: a b c d a 90 10 0 0 b 0 80 10 10 c 0 0 95 5 d 0 10 5 85 I want to ...