Questions tagged [tables]

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

Filter by
Sorted by
Tagged with
881 votes
23 answers

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}{|...
Denilson Sá Maia's user avatar
453 votes
13 answers

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 ...
JustDanyul's user avatar
  • 4,907
304 votes
4 answers

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{...
Covi's user avatar
  • 6,875
303 votes
12 answers

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 ...
RoflcoptrException's user avatar
272 votes
15 answers

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 ...
250 votes
4 answers

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.
csgillespie's user avatar
  • 5,138
242 votes
2 answers

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)...
NP01's user avatar
  • 2,885
230 votes
7 answers

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?
bada's user avatar
  • 4,187
226 votes
5 answers

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.
zfm's user avatar
  • 8,827
221 votes
10 answers

Table with multiple lines in some cells [duplicate]

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 ...
Grzenio's user avatar
  • 9,235
220 votes
4 answers

Increase LaTeX table row height [duplicate]

How does one increase the height of the rows in a LaTeX table?
user1965914's user avatar
  • 2,431
214 votes
5 answers

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 | |...
Frank's user avatar
  • 7,025
199 votes
5 answers

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. ...
Nathan Farrington's user avatar
188 votes
8 answers

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 ...
Rafid's user avatar
  • 5,617
188 votes
3 answers

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, ...
184 votes
6 answers

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 ...
maxschlepzig's user avatar
175 votes
26 answers

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 ...
krlmlr's user avatar
  • 12.4k
167 votes
6 answers

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?
Prelude's user avatar
  • 4,182
165 votes
2 answers

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 ...
Mazzy's user avatar
  • 7,612
163 votes
1 answer

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] ...
Keelan's user avatar
  • 5,373
146 votes
7 answers

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)?
levesque's user avatar
  • 12.9k
145 votes
3 answers

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} \...
anna's user avatar
  • 1,627
142 votes
7 answers

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 ...
Mnementh's user avatar
  • 4,117
142 votes
2 answers

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$ ...
user avatar
141 votes
3 answers

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] \...
BrettHarry's user avatar
  • 3,341
140 votes
2 answers

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 ...
wishihadabettername's user avatar
128 votes
9 answers

Footnote in tabular environment

I thought that footnotes would have only a problem with the table environment, but none of the answers in Footnotes in Tabulars? Footnote in table seem to work for the tabular environment. \...
strpeter's user avatar
  • 5,155
123 votes
5 answers

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}}}...
roxrook's user avatar
  • 9,797
123 votes
2 answers

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 ...
Aku's user avatar
  • 10.8k
121 votes
1 answer

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?
Vaibhav's user avatar
  • 6,535
117 votes
1 answer

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 ...
Marcos Roriz Junior's user avatar
114 votes
11 answers

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{\...
celenius's user avatar
  • 5,216
114 votes
3 answers

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 ...
Levi H's user avatar
  • 1,481
113 votes
8 answers

How to center column values in a table? [duplicate]

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 ...
LearnToGrow's user avatar
  • 2,519
110 votes
5 answers

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\...
Isai's user avatar
  • 4,113
107 votes
2 answers

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 ...
Werner's user avatar
  • 595k
106 votes
2 answers

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 ...
pixel's user avatar
  • 2,393
105 votes
4 answers

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}
Matthias's user avatar
  • 1,709
100 votes
4 answers

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, ...
Mirrana's user avatar
  • 2,561
98 votes
3 answers

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 ...
user avatar
96 votes
4 answers

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?
Vinod's user avatar
  • 1,329
95 votes
3 answers

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 ...
Dejan's user avatar
  • 1,532
92 votes
6 answers

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. ...
robintw's user avatar
  • 7,232
89 votes
7 answers

The space between the table and its caption is very small

I have a table written like this: \begin{table} \centering \begin{tabular}{|l||c|c|} \hline&Column 1&Column 2\ \hline\hline cell1 & cell2 & cell3 \\ \hline ...
Mohamed Khamis's user avatar
88 votes
2 answers

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: &...
Alexander Qvist-Hellum's user avatar
88 votes
5 answers

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}{|...
yohbs's user avatar
  • 1,459
87 votes
2 answers

How to adjust a table to fit on page [duplicate]

I have the following latex table: \begin{table}[ht] \centering \begin{tabular}{rlrrrrrrr} \hline & X & MASHvstRap & MASHvsBEEML & tRapvsBEEML & frequency & Mash\_mean & ...
Sander Van der Zeeuw's user avatar
87 votes
3 answers

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 ...
David LeBauer's user avatar
87 votes
5 answers

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 ...
damusnet's user avatar
  • 1,307
87 votes
4 answers

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?
superhuman1314's user avatar

2 3 4 5