46 votes

What is the difference between tabular, tabular* and tabularx environments?

Check out the following MWE: \documentclass{article} \usepackage{tabularx} \begin{document} \begin{tabular}{|l|c|r|} \hline foo & bar & fubar \\ fubar & toobar & foo \\ ...
Philipp Imhof's user avatar
36 votes
Accepted

Vertical centering of all columns in \tabularx environment

It seems that addition of \renewcommand\tabularxcolumn[1]{m{#1}}% for vertical centering text in X column in your preamble is what you looking for: \documentclass{article} \usepackage{geometry} \...
Zarko's user avatar
  • 293k
34 votes

What is the difference between tabular, tabular* and tabularx environments?

I will begin by showing a screenshot of tabular, tabular* and tabularx versions of one and the same, admittedly contrived, table. The material in the first column is left-aligned; the material in the ...
Mico's user avatar
  • 496k
31 votes

Tabularx: Break long tables over several pages

You cannot use the longtable package if you want to preserve the X column. Therefore you could use ltablex. \documentclass[12pt]{article} \usepackage{mathptmx}% \usepackage{tabularx} \usepackage{...
TeXnician's user avatar
  • 33.4k
19 votes
Accepted

When should the tabularx environment be used or not?

Is the tabularx environment useful? Yes. But it's no environment intended to replace tabular with (i.e. it makes no sense to make every tabular a tabularx). When should we use the tabularx ...
TeXnician's user avatar
  • 33.4k
19 votes

Improve appearance of the table in Latex

I would rather have table with following design: Edit: In comparison with your table code I made the following changes: With use of geometry package and its default settings for pages' borders the ...
Zarko's user avatar
  • 293k
17 votes

When should the tabularx environment be used or not?

TeXnician already said when it's useful, I would like to add when it is detrimental. Never use tabularx without an X column! Sometimes I saw questions with this wrong usage here, never do that! \...
CarLaTeX's user avatar
  • 61.3k
16 votes
Accepted

How to draw a half and half colored circle?

Something like this? \documentclass[12pt,a4paper]{memoir} \usepackage[utf8]{inputenc} \usepackage{tikz,float} \usepackage{tabularx} \usepackage{xparse} \NewDocumentCommand{\statcirc}{ O{#2} m }{% ...
Troy's user avatar
  • 13.7k
15 votes

What is the difference between tabular, tabular* and tabularx environments?

Plain LaTeX tabular Every column takes its space, the total width of the table is the sum of the columns (plus inter-column space). ***% \begin{tabular}{p{2cm}p{2cm}p{2cm}} a a a a a a a a a a a a ...
gernot's user avatar
  • 48.7k
14 votes
Accepted

how to make font size small in a tabular environment

Yes, it does. The difference between \small and \normalfont is just not very large, so you maybe just didn't notice it. There are in general two ways to go (and your example contains both): set a ...
Tiuri's user avatar
  • 7,699
14 votes

When should the tabularx environment be used or not?

The important thing to note about tabularx that it is all about automatically setting the target length for line breaking within a column. However the vast majority of data tables in scientific ...
David Carlisle's user avatar
14 votes

tabularx inside tcolorbox not centered properly

Since line breaking inside the cells is neither expected nor desirable, and since the natural widths of the four columns are quite different, using a tabularx environment seems wrong. I suggest you ...
Mico's user avatar
  • 496k
13 votes
Accepted

Why does tabularx fail with siunitx?

This is due to a change in expl3 interacting with some low-level code in siunitx: the latter is there due to a slight 'gap' in the coverage of useful functions by expl3. For the present, adding \...
Joseph Wright's user avatar
  • 257k
13 votes
Accepted

Overfull in tabularx with siunitx

siunitx expects the last column to contain a number with two digits in front and two after the decimal sign. It cannot know about the % sign. \documentclass[11pt,draft]{report} \usepackage{tabularx} \...
samcarter_is_at_topanswers.xyz's user avatar
12 votes
Accepted

Why is the start row of \rowcolors ignored in tabularx?

Obviously tabularx doesn't have bugs, this is a documented feature. TX sets the table several times, and restores latex counters but tex primitive counters can not be restored so easily. This defines ...
David Carlisle's user avatar
12 votes

How to draw a half and half colored circle?

One more (and simple) example with use of shapes.geometry packages :-) \documentclass[12pt,a4paper]{memoir} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{...
Zarko's user avatar
  • 293k
12 votes

siunitx: How to remove the minus sign, if a number is rounded to zero?

Indeed siunitx keeps the sign of the original number. As an alternative you can round using pgfplots, which removes the sign for fixed output (it keeps the sign in scientific output). This can be ...
Marijn's user avatar
  • 35.9k
12 votes
Accepted

Improve appearance of the table in Latex

I suggest you use a tabularx environment, with width set to \textwidth, ragged-right rather than full justification in all five columns, and a bespoke itemize-like environment (called mylist in the ...
Mico's user avatar
  • 496k
11 votes

Table layout with tabularx (column widths: 50%|25%|25%)

My new LaTeX3 package tabularray is an alternative to the outdated tabu package: \documentclass{article} \usepackage{tabularray} \begin{document} \begin{table}[htbp] \centering \begin{tblr}{ ...
L.J.R.'s user avatar
  • 10.6k
11 votes
Accepted

tabularx with different column widths

I suppose you want the m column type width should be 40 % of the b type width, and the s type width half the m type width. The way you calculated the coefficients is not correct: the sum of the ...
Bernard's user avatar
  • 270k
11 votes

Horizontal icons between subfloats

It's not clear you need a table at all: \documentclass{report} \usepackage{pifont} \usepackage[svgnames, x11names]{xcolor} \usepackage{graphicx } \usepackage{caption} \usepackage{subfig} \usepackage[...
David Carlisle's user avatar
11 votes
Accepted

Aligning +- sign in table

For such tables I'd recommend siunitx: \documentclass[12pt, twoside]{report} \usepackage[utf8]{inputenc} \usepackage{booktabs,siunitx,amsmath,caption} \sisetup{separate-uncertainty} \begin{...
egreg's user avatar
  • 1.1m
11 votes
Accepted

Different problems with tabularx

newer add \\ after \hline in second row you not used \hline after \hline, consequently the content in the first cell in this row is correctly placed before and after itemize are always added vertical ...
Zarko's user avatar
  • 293k
11 votes
Accepted

Apply a color gradient to lines of a tabularx

With {NiceTabular} of nicematrix. That package provides environment similar to the classical environments {tabular} and {tabularx} but which creates PGF/Tikz nodes under the cells, rows and columsn. ...
F. Pantigny's user avatar
  • 38.5k
10 votes
Accepted

How to produce this table in latex with inconsistent lists/items?

The answer would be to put the list inside a minipage or parbox, but that is not really fun. Here is another solution with enumitem using the before and after keys and the command \tablistcommand: ...
Arash Esbati's user avatar
  • 7,280
10 votes

How to draw a half and half colored circle?

We, at work, also use the quarter semaphores. It's easy to do with tkz-euclide package. I have created a pic with three args: background color, grade (90/180/270) of the angle of the sector which has ...
CarLaTeX's user avatar
  • 61.3k
10 votes

siunitx: How to remove the minus sign, if a number is rounded to zero?

You could use \fpeval to round the numbers and then siunitx to format them: \documentclass{article} \usepackage{siunitx,xfp} \usepackage{booktabs, tabularx} \begin{document} \sisetup{round-mode=...
Ulrike Fischer's user avatar
10 votes

How to draw a table 2*1+3*1 in `tabular`:

An alternative to tabular...stacked \frameboxes. \documentclass{article} \usepackage{stackengine} \setstackgap{S}{\fboxrule} \begin{document} \Shortstack{% \framebox(100,30){} \framebox(100,30){}}% \...
Steven B. Segletes's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible