Questions tagged [tables]
{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.
14,219
questions
718
votes
20answers
808k 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:
\begin{tabular}{|...
369
votes
10answers
567k 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 ...
269
votes
3answers
508k 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}
\begin{...
243
votes
8answers
704k 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 ...
228
votes
12answers
248k 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 ...
201
votes
3answers
384k 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.
188
votes
1answer
368k views
Make a table span multiple pages
I have a table that takes up a full page, but I want it to start on a page that already has some text and then continue onto the next page (i.e. it's ok if the table gets broken up and spans two pages)...
184
votes
4answers
378k views
Increase LaTeX table row height [duplicate]
How does one increase the height of the rows in a LaTeX table?
183
votes
6answers
363k 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?
174
votes
4answers
207k 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.
169
votes
3answers
78k 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, ...
168
votes
3answers
316k 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 |
|...
165
votes
26answers
35k 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 ...
158
votes
6answers
101k 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 ...
158
votes
6answers
342k 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 ...
152
votes
8answers
350k views
Table with multiple lines in some cells
What is the easiest way to have 2 lines in some of the cells in a table?
The only way I can think right now is to actually have 2 separate rows (without the line in the middle) and use \multirow on ...
144
votes
4answers
433k 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.
...
140
votes
5answers
297k 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?
139
votes
2answers
308k 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 could ...
133
votes
1answer
280k views
Page-wide table in two-column mode
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]
...
124
votes
6answers
249k views
LaTeX tables: How do I make thicker or thinner horizontal lines (typically \hline)?
The title says it all:
In LaTeX tables: How do I make bold horizontal lines (typically \hline)?
123
votes
5answers
65k 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 ...
121
votes
2answers
78k 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 ...
116
votes
2answers
301k 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]
\...
109
votes
1answer
141k 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?
105
votes
6answers
225k views
Footnote in tabular environment
It seems as if footnotes would have only a problem with the table environment but in my minimal example non of those answers
Footnotes in Tabulars?
Footnote in table
seem to work for the tabular ...
103
votes
2answers
444k views
How to center the table in Latex
I have got a simple code to generate table in Latex.
\begin{tabular}{ | c | c | c | }
\hline
symbol & value & unit \\ \hline
$z Na$ & 11 & - \\ \hline
$z F$ ...
100
votes
1answer
605k views
How to use \multirow
I can compile this table separately but when I want to compile the whole file, it gives me an error, which is fixed by removing \multirow.
\usepackage{multirow}
\begin{table}[htbp]
\begin{center}
\...
97
votes
2answers
419k views
How to fix table position
Table does not show up at the same position it was inserted in the TeX file. I got the understanding through bit of reading on this forum that they are floats and they pick the best place on the ...
92
votes
4answers
153k views
How to rotate text in multirow table?
I have a big table with a problem, when I want to rotate the text in a \multirow cell, the text is placed outside and is bigger than the dimensions of the cell, I took some advice from here, using\...
92
votes
4answers
140k 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)$ \\
$-2xe^{-x^{x^{x^2}}}...
92
votes
1answer
192k views
Change align of a single cell in tabular [duplicate]
Possible Duplicate:
Aligning inside tabular environment, specific cell
I have a simple table with a given align. I want to know if there is a way to specify a different align for a cell. For ...
91
votes
8answers
162k views
Inserting a small vertical space in a table
Is there a way that I can insert a small space in a table?
When I use a superscript, the number touches the \hline.
\documentclass[9pt,letterpaper]{article}
\usepackage{helvet}
\renewcommand{\...
90
votes
3answers
105k views
Math mode in tabular without having to use $…$ everywhere
\begin{tabular}{|l|l|l|}
\hline
Column A & Column B \\
\begin{math}
x & y \\
\end{math}
\end{tabular}
This won't let me compile and gives a lot of errors, how do I enable math mode in a ...
86
votes
2answers
112k 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 ...
85
votes
2answers
244k views
How do I color table columns?
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, ...
84
votes
3answers
74k 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}
83
votes
4answers
72k 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. ...
82
votes
3answers
12k 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 ...
81
votes
2answers
45k 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?
80
votes
5answers
137k 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 ...
80
votes
3answers
227k views
Add notes under the table
I'm using the latex package apa6e because the apa package isn't using APA style version 6 yet.
Now I'm trying to add a table with notes right underneath it, like in this table for instance:
Since ...
75
votes
7answers
65k 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 ...
75
votes
1answer
16k views
My table doesn't fit; what are my options?
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 ...
74
votes
3answers
67k views
How can I center a too wide table?
I have a document containing a table which is slightly too wide for the page. But instead of growing to the right side only, I would like to have it centered on the page.
I have tried to use the ...
73
votes
2answers
139k views
Automatic line-break in tabular
I'm making a tabular and I'd like to automatically do a like break rather than going beyond the page.
This is my tabular code:
\begin{table}[h]
\begin{tabular}{|l|l|l|}
Use Case Navn: &...
71
votes
3answers
247k views
How to center column values in a table?
How can I center the column values in this code?
\documentclass[conference]{IEEEtran}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
...
71
votes
4answers
596k 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:
\...
71
votes
3answers
163k views
How to use itemize in Table environment
I want to create a table like the picture below, and i wish to itemize the lamba_1 > lamba_2 > 0 using 'item style', which is the cell of each categories. Can someone help me?
70
votes
3answers
121k views
Vertical spacing of a table cell
I want to tabulate formulas, but I find that the lines of the table cells are too close together, and this is aesthetically unsatisfactory. Example (formulae copied from wikipedia):
\begin{tabular}{|...