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

16
votes
1answer
523 views

automatically insert data in a complex table

I have a relatively complex table that looks like this: The same table structure is going to be repeated so many times. I already have the tables in MS Word. My question is if there is an easy ...
16
votes
2answers
1k views

Aligning inside tabular environment, specific cell

I'm trying to align specific content of the single cell. For example, \begin{tabular}{|r|r|} \hline 1 & 2 \hline right & to_the_left \hline 1 & 2 \hline ...
15
votes
3answers
4k views

Rounding numbers in a table / Truncating text in table

Is it possible to have automatic rounding of numbers in a table? Say that I have this, made in the usual way with a tabular environment: pi | 3.14592654 e | 2.7182818284 phi | 1.6180339887 Can ...
13
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 ...
12
votes
2answers
6k 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 ...
12
votes
1answer
817 views

Curly brackets around a table

I would like to have braces on the left side of a table (either that or on the right side) and bellow the same table. What I have got is $ m-Mal \underbrace{ ...
12
votes
2answers
17k views

Insert image and list inside a table

I am trying to add both an image and list inside a table but I face various problems. As shown in the picture, the image is above the first horizontal line and also the lists are not properly ...
9
votes
3answers
9k 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 ...
8
votes
1answer
487 views

Change text color in table, preserve ability

I'm having difficulty creating a new command for \rowstyle that allows me to color the text of different rows in a table and preserve my ability to space out the columns and not induce space between ...
8
votes
4answers
628 views

How to make 4 equal paddings (left, right, top, bottom) in a table cell?

I want each cell in a tabular to have 4 equal paddings of exactly 15pt each. How to make 4 equal paddings (left, right, top, bottom) in a table cell? \documentclass{article} ...
7
votes
2answers
7k views

Create a table with LaTeX

I need to copy a table from a pdf file to my LaTeX document. I know I have to do it by hand but still don't understand how to create a table with LaTeX.
7
votes
3answers
316 views

How to execute command on every table column

I have a table where I have to execute the same command for every entry in the table. For example: \ibibleverse{Matthew}(1:1) & \ibibleverse{Mark}(1:1) & \ibibleverse{Luke}(1:1) \\ ...
6
votes
1answer
901 views

Wrapping text in enumeration environment around a table

I would like to wrap the text in an enumerate environment around a table, this is my actual situation (sorry for including so much code, but I wanted to give a precise idea of the number of lines in ...
6
votes
2answers
2k views

Indent all but first lines of paragraph.

Inside of a table column with a width determined by a p{5in} tag, I want all but the first line of text to be indented. Is there any way to achieve this? Doing it by hand would make later edits ...
4
votes
1answer
166 views

Making a class to generate colored tables with a predefined layout

This is a follow-up question in which I asked how to define classes with \newcommands into \newenvironments, and I had some good answers to this particular issue. However, the problem that I have ...
4
votes
1answer
2k views

Table with multiple merging

Most of the places, examples for merging of cells in tables are given. But, I could not find a merging of cells in complicated fashion as shown below. This question may summarize all the possible ...
3
votes
3answers
611 views

How to create columns within an itemize environment?

I want to generate a list of the following syntax for a resume. * <Description of Activity> <empty space> <right aligned date> Currently I have been using a form such as ...
15
votes
3answers
2k 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: ...
14
votes
3answers
6k views

Aligning Decimal Points in Table

I want to align two numbers in two different rows the decimal point. I do see a link for that here: Aligning numbers by decimal points in table columns However, I don't understand how to ...
10
votes
3answers
205 views

Special Table with Diagonal lines [duplicate]

Recently, I have to work with some problems that require to draw table like below in LaTeX. I used to think about diagonal line inside a cell, but it's not a good choice for this problem since the ...
10
votes
2answers
654 views

How to align integers on the right, but still center them

Suppose we have a table like this: \begin{tabular}{c} Heading \\ 1 \\ 10 \\ 100 \\ \end{tabular} This will center all the numbers. If I want to align them to the right, I could change the column ...
9
votes
1answer
80 views

How do I make an exact copy of a table, but keep its number for referencing?

I have a table, and I want to print it twice in my document. I want them to have the same label, caption and number, so that in the caption when it says "Table 1: foo" the same number shows up, and so ...
9
votes
3answers
291 views

Inserting an image properly in a table

I'd like to insert those lines that from "Foo" point to the four different rows in the table. I've tries inserting an image but it doesn't come out right (please ignore the bad quality of the ...
9
votes
2answers
1k views

Automatic way to break narrow tables into two columns?

Is there an easy way to break long narrow tables into two (or possibly more) columns (i.e. without manually rearranging the columns)? In the following example you can see that there is a lot of ...
8
votes
2answers
258 views

Accessing values from tables via “grid search”

I am trying to achieve the following: I want to access a number from a table in the main text and make some calculations with it. For example, if there is a value 1.85 in the table I want to store it ...
8
votes
1answer
1k views

Resizing a table by textheight

Say, I have a table which doesn't fit on one page. Say, I don't want to use any special table types or so but want to solve the problem by using the \resizebox-command and keep my ratio. If by using ...
7
votes
1answer
2k views

Putting LaTeX table legend in a “x\y” style [duplicate]

Possible Duplicate: Tables of numbers Is it possible to put a "x\y" style legend in one cell (maybe be made up of several cells) of a table? It would be great to make the 'x' slightly lower ...
6
votes
1answer
145 views

Table including rows of a master table

I have a big master-table* containing reference items and that is a simple cross-project database of such items. Now I'd like to include in different documents parts of this master table and select ...
6
votes
1answer
5k views

How to Label and Caption a Tikzpicture inside a tabular environment

What is the correct way to label and captionize a tkizpicture inside a tabular environment? (Since figures are not allowed inside a tabular) Excerpt from my .tex: \begin{tabular}{l r} & ...
5
votes
2answers
2k views

Wider tables in LaTeX, which is the best solution?

Hi I have a LaTeX table code generated from R like the following \usepackage{rotating} ... \begin{sidewaystable} \begin{center} \small\addtolength{\tabcolsep}{-7pt} ...
5
votes
1answer
4k views

Color running over text in multirow column

I have a simple table with 2 multirow cells. However when I apply background color, it covers the lower portion of the multirow cells and cuts through the middle of my text entry which is obviously ...
4
votes
2answers
211 views

How to color my (custom) lines/rules in a table contained by mdframed?

As a follow up to my recent question: Now I'd like to put some color on to that line/rule. In the MWE below, \arrayrulecolor{blue}\mycline{1-1} throws an error (undefined control sequence with respect ...
4
votes
2answers
805 views

siunitx rounding in table with parentheses

I'm trying to create a standard regression table with standard errors in parentheses below the coefficients, while using siunitx to align the numbers on the decimal point, and to round the numbers. ...
4
votes
3answers
2k views

Too long vertical lines in table

Ok, I've looked at this code too long and need some fresh eyes and ideas. Question: Why do I get too long vertical lines on my LaTeX table? Please note that I've not experiencing any problems with ...
3
votes
3answers
1k views

Itemize inside longtable

I have the following (Non-working) example. \renewcommand*{\arraystretch}{1.8} \begin{longtable}{lcl} \caption{Summary of proven determinants for falling}\\ \toprule ...
13
votes
2answers
1k 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 ...
12
votes
1answer
2k views

How to remove top and bottom whitespace of longtable?

I am using longtable instead of tabular environment and noticed that it puts some additional whitespace at the top and at the bottom of the table. Is there some way to remove it (something less hacky ...
10
votes
1answer
11k 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] ...
10
votes
2answers
1k views

Justify Table by Row

For example, is it possible to justify the first row of a table differently from the rest? Maybe there is a way to combine two tables to look like one? MWE: \documentclass{article} \begin{document} ...
9
votes
2answers
142 views

Framing cells vertically in a table

I want to add a box in a tabularx table that would frame several cells vertically. There is this post that shows how to frame cells horizontally (Framing cells in a table), but I cannot figure out how ...
9
votes
2answers
268 views

Best practices longtable

I have a long table with the explanation of 50 items (the MWE displays only 9). I believe this is hard to read. How do I make it easy to read? \documentclass[10pt,cleardoublepage=empty,twoside]{book} ...
9
votes
5answers
656 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 ...
9
votes
1answer
2k views

Table typesetting with pgfplotstable

I have two questions concerning pgfplotstable and number formatting with pgf. Consider the following piece of code: \documentclass{article} \usepackage{pgfplotstable} \usepackage{amsmath} ...
9
votes
2answers
669 views

Protrusion of fractions in tabulars

I have a number of tables in a book that I am busy with that have quite a few tables of the general form shown below: If you notice the fractional part of the numbers 5 1/2 and 16 1/2 protrude to ...
8
votes
2answers
8k views

Vertical alignment in tabular cells with variable height

I have the code: \documentclass{article} \usepackage[a4paper]{geometry} \usepackage{tabularx} \usepackage{lipsum} \begin{document} \begin{tabularx}{\textwidth}{ | X | c | } \hline \lipsum[1] ...
8
votes
2answers
2k views

Cannot use \toprule when doing \input inside tabular — why?

Using \input inside a tabular environment does not seem to work in all cases, but I don't see why. The MWE below gives the following error message: ! Misplaced \noalign. \toprule ->\noalign ...
7
votes
4answers
340 views

Table Frames beyond simple lines

Is there a possibility to create frames for tabulars, that go beyond a simple line? \begin{tabular}{|l|l|} \hline A & B\\ \hline C & D\\ \hline \end{tabular} creates lines as a "frame", but ...
7
votes
2answers
392 views

How to shrink a table automatically so that it fits onto a page?

I have a table that looks like this: \begin{table}[h] \centering \caption{MYCaption} \label{tbl:table1} \begin{tabular}{|l|l|l|l|} \hline \rowcolor[gray]{.8} \multicolumn{4}{|c|}{Team 1}\\ \hline ...
7
votes
2answers
2k views

\lstinline!Foo! vs \lstinline{Foo}

I wonder what is the difference or correct usage of \lstinline!...! and \lstinline{...}? I like better {} because I feel there it's more consistent with other commands but for example in below ...
7
votes
3answers
1k views

How can I achieve proper vertical spacing for long blocks of text within a \multirow?

I'm trying to work with a table of the form: \begin{tabular}[]{l D{.}{.}{-1}} \multirow{2}{1in}{Here is a ton of text that is not going to fit in one single line in this 1 inch column.} ...