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

15
votes
3answers
390 views

Is it possible to use the pipe character, |, to separate cells in a table?

I was wondering if it is possible to use the pipe character, |, instead of the & to separate cells. Something like this: c1 | c2 | c3 \\ c4 | c5 | c6 \\ instead of this: c1 & c2 & c3 ...
15
votes
6answers
2k views

Creating Table: On Mastering LaTeX

Guys, I am one the process of mastering LaTeX, so that later when times come I shall be fully prepared to typeset almost anything without thinking twice. So during this awesome process, I am now ...
15
votes
3answers
804 views

Mathematical functions inside LaTeX tables

I have several tables where I have tables which may look like this: ------------------------------------- | X | Y | X + Y | X - Y | (X + Y)/2 | ------------------------------------- | | | | ...
15
votes
2answers
22k views

Including Large Tables in a beamer Frame

What is the best way of including large tables in a beamer presentation?
15
votes
1answer
40k views

horizontally center table

Strangely in this MWE the table is shifted to the left but in my original document I have exactly the same code but the table is centered. Can anyone solve the mystery? \documentclass{article} ...
15
votes
2answers
626 views

moving the whole word to next line when there is no free space

Is there any option in tabular that can move the whole word to the next line whenever the length of the word is greater than the fixed cell size? Currently I use \begin{tabular}{ | p{2cm} | } And ...
15
votes
2answers
12k views

Evenly distributing column widths

Consider the following hunk of code: \begin{tabular}{| c | c | c | c | c | c | c | } \cline{2-7} \multicolumn{1}{c}{} & \multicolumn{3}{|c|}{Fantastical aardvarks} & ...
15
votes
3answers
3k views

Problem with redefining Tabular environment with the \renewenvironment ‎command‎

In a book I'm typesetting, I want the tabular environment to be in footnote size and the other body of the book to be in normalsize font. To do this, I've tried something like the following: ...
15
votes
1answer
15k views

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 \\ ...
15
votes
2answers
14k 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 ...
15
votes
4answers
4k views

Why can't I wrap \rowcolor in \only? (Beamer)

See the following minimal example: \documentclass[table]{beamer} \begin{document} \begin{frame}{Boo} \begin{table} \centering \small \begin{tabular}{rcc} \only<1>{\rowcolor{green}}Hey & ...
15
votes
2answers
3k views

How to create new table environment

I am working on a book that has many many such tables. Is there a way to create shortcut for the code shown below. I want to make table caption a variable, because in the MWE shown below except ...
15
votes
1answer
16k views

How to draw a double \hline in a table without interrupting vertical lines

I need to draw a double line after the first row in a table, but when using \hline twice, this interrupts the vertical lines: \documentclass{article} \begin{document} \begin{tabular}{|c|c|c|} \hline ...
15
votes
1answer
2k views

coloring every other row of a table, with vertical lines

I am making a table that needs every other row colored. I thought to use this. \usepackage[table,svgnames]{xcolor} \rowcolors{1}{white}{gray!15} But my table has vertical bars ...
15
votes
2answers
3k views

Align Equations Over Multiple Tabular Rows

I'm trying to set up a table with some equations in it, however I would like the equations on multiple rows to be aligned properly. So far I have \begin{tabular}{cc} \hline \multicolumn{1}{l}{Header ...
15
votes
2answers
1k views

Tables: Colouring odd/even mixed up

I have a huge document (around 100 pages) and a lot of tables in it. I used \usepackage[table]{xcolor} \definecolor{lightblue}{rgb}{0.93,0.95,1.0} \rowcolors{1}{white}{lightblue} % odd = white, even ...
15
votes
3answers
20k 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?: ...
15
votes
1answer
851 views

Align numbers and separated uncertainties in tables with S columns

If I have a table like this \documentclass{article} \usepackage{booktabs} \usepackage[separate-uncertainty=true]{siunitx} \begin{document} \begin{table} \centering \begin{tabular}{ ...
15
votes
1answer
6k views

Coloring columns in a table with colortbl and booktabs

I have created a rather complicated table with some columns that I want to color. For the table, I chose the booktabs and tabularx packages. For coloring the columns, I use colortbl. The problem that ...
15
votes
1answer
105 views

A command to move forward to a specific (numbered) column?

Suppose I want a \gotocolumn command, with the following behavior: in a tabular with n or more columns, \gotocolumn{n} would expand to the shortest combination of \\ and & necessary to bring us ...
14
votes
3answers
8k 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 ...
14
votes
2answers
46k views

Combine 4 cells in a table

Here is some simple table - I cannot upload, because I'm just a guest. I want to merge 4 cells. I mean I want to combine three "this" area in this table. I thought I have to use multirow and ...
14
votes
5answers
813 views

Alignment in inline math

I want to enclose a tabular environment with a bracket, inside an enumerate environment, and be aligned to top. In the following example: \documentclass[a4paper]{article} \begin{document} ...
14
votes
5answers
10k views

Align Note below table

My question concerns the "Note" below the table. This is my code: \begin{table} \begin{center} \caption{ Descriptive statistics of total sample based on modified data set}\label{table:descrtotal} ...
14
votes
5answers
2k views

In a tabular, how to left align ignoring minus signs?

I'd like to create a table that is aligned left, but minus signs are ignored. E.g., the following gives a normal left-aligned table \begin{tabular}{llll} & a & b & c ...
14
votes
3answers
1k views

How to make a row in a table shorter?

I have a row of a table (tabular) that has small text (tiny). I would like to make this (first) row shorter, either automatically (automatic height) o̶r̶ ̶m̶a̶n̶u̶a̶l̶l̶y̶ ̶(̶s̶e̶t̶ ̶a̶ ...
14
votes
2answers
2k views

coloring entire row of tabular*

I would like to have the first row of all my tables colored with a certain color (below yellow) but somehow below thing is not working as expected This: \documentclass[a4paper, 12pt]{report} ...
14
votes
2answers
3k views

Set table background hatched and shaded using tikz

I am looking for a convenient way to set the background of tabular cells. I'd like to do two things: (1) Set the background shaded in a color (2) Set the background hatched I learned that the TikZ ...
14
votes
1answer
3k views

Drawing Karnaugh's maps in LaTeX

I've been using LaTeX for a couple of years, but I'm pretty new to the tikz package. In particular, I'd like to add Karnaugh's maps in my document. I've already found a solution that satisfy me (can ...
14
votes
2answers
382 views

Very slight discontinuities in table borders

Tables in LaTeX all seem to have slight discontinuities in the outside vertical borders - little notches that are only really visible if you zoom in. Example: \documentclass{article} ...
14
votes
2answers
5k views

Vertical table lines are discontinuous with booktabs

I created a table in LaTeX, but there are some problems with the borders. The borders remain open whereas I want them closed. Also, in the last row, I want the vertical line gone, ie I want just one ...
14
votes
3answers
12k 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 ...
14
votes
1answer
13k views

How to make a \cline or \cmidrule narrower?

I'm trying to copy this table into TeX: I have problems with the horizontal lines under "Gaussian" etc. When I specify three \cmidrule's, they are not separated but are combined into one big ...
14
votes
2answers
4k views

tabularx inside a \newenvironment

There's something wrong with this code: \newenvironment{Tbl} {\begin{tabularx}{\textwidth}{|l|X|} \hline} {\end{tabularx}} but this is fine: \newenvironment{Tbl} {\begin{tabular}{|l|l|} \hline} ...
14
votes
2answers
9k views

\flushleft with p{} option in tabular

If I have defined tabular alignment with the p{} option, \begin{tabular}{p{.3\textwidth}p{.7\textwidth}} ...(contents)... \end{tabular} Is there a way to specify that I want it \flushleft without ...
14
votes
2answers
300 views

How to set tikzmarks with \noalign at the edge of tabular rows

I'm trying to improve the lines in a tabular with colored rows (lines above a colored row can disappear in the adobe reader at some zoom levels) by redrawing the line above a row after the row itself ...
14
votes
1answer
33k views

Multi columns in latex

I am having problems with tables in latex. Here is what I want: Regressors Model 1 Model 2 Coefficient1 Lower1 Upper1 ...
14
votes
1answer
7k views

in-cell newlines (in tabular environments)?

I'm working on a table containing multi-line cells and I wonder if the following concept is supported by LaTeX. The concept itself is simple: allow a cell to span multiple lines by increasing the ...
14
votes
1answer
848 views

What is the command \span?

I have bumped into the \span primitive a couple of time. I got the impression it is defined in the TeX program, not even in plain.tex. Is that right? And what does that command do and what is it for?
14
votes
1answer
14k views

Change caption font size

I want to change the font size of a single rotated table caption (definitely not all the captions in all my tables/figures) Right now I can wrap the text inside the \caption around a \scriptsize{} ...
14
votes
1answer
7k views

Cellcolor overwrites partial horizontal lines (\cline)

So I need to make a colored table with multirows, together with the use of partial horizontal lines. I used \cline which does not work: the \cellcolor-command overwrites the line. This question told ...
14
votes
3answers
2k views

How do I make a square table in LaTeX?

How can I make a perfectly square table in LaTeX? Each cell will just have a single character in it. I'm trying to print a pretty tabula recta as shown below.
14
votes
3answers
21k views

Problem with Table Vertical Alignment

I want a table whose first column is aligned top, second column is aligned middle, and third column is aligned bottom; like this: I wrote the following code: \documentclass{article} ...
14
votes
1answer
329 views

Tabular inside tcolorbox breaks beamer \pause?

Consider the following code: \documentclass{beamer} \usepackage{tcolorbox} \begin{document} \begin{frame} some text before \pause \begin{tcolorbox} \begin{tabular}{cc} cell1 & ...
13
votes
3answers
8k views

Example of fancy table using TikZ package

Can anyone share me several fancy table templates? I want to make this thread like a reference so that each time I need a template, I could just go here. If you can, please provide a screenshot for ...
13
votes
5answers
2k views

What is the proper way to create a horizontal table?

I want to have a horizontal table, like this: However, when using the usual method of creating a table, it quickly becomes a pain having to pre-define the number of columns (especially since I ...
13
votes
5answers
18k 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 ...
13
votes
5answers
538 views

Coloring negative and positive numbers automatically

I believe numprint.sty is not working. at least the manual states that Printing negative numbers in red does not work. Only the minus sign is printed in red. When was this bug introduced? Some ...
13
votes
4answers
299 views

How to clarify and enliven a dense table

I have a table that is quite dense: Any ideas how could make this easier to read, specifically in terms of distinguishing between different rows and columns? Was thinking Excel-style cell shading ...
13
votes
3answers
1k views

How can I create this game-tree in Latex?

I have the following figure: As of now I create this in Word/Powerpoint and paste the screenshot in a LaTeX file. Is there a way to create this natively? Also, what would be the advantage of doing ...