Skip to main content
10 votes
Accepted

Get rid of extra white space inserted when using \verb with tabularx

You can use \Verb from fancyvrb, but with the better definition provided by fvextra. \documentclass{article} \usepackage{tabularx} \usepackage{fvextra} \begin{document} \Verb|tabular| \noindent \...
egreg's user avatar
  • 1.2m
9 votes
Accepted

How to frame certain cells with tabular?

Use tabularray: \documentclass[]{article} \usepackage{xcolor} \usepackage{tabularray} \begin{document} \begin{tblr}[]{ colspec={ Q[0.15\textwidth] Q[0.25\textwidth] ...
M. Al Jumaily's user avatar
9 votes

How to frame certain cells with tabular?

With {NiceTabular} of nicematrix. The red frame is drawn by using the command \Block and its key draw. \documentclass{article} \usepackage{xcolor} \usepackage{nicematrix} \begin{document} \begin{...
F. Pantigny's user avatar
  • 43.8k
7 votes

How can I draw inner vertical line centered in tabular?

With the tabularray package, you could use the hspan=even option to distribute the columns evenly: \documentclass{article} \usepackage{tabularray} \begin{document} \begin{tblr}{ colspec={|c|c|c|}, ...
samcarter_is_at_topanswers.xyz's user avatar
6 votes
Accepted

tabularx - column width multicolumn

The issue is that while you define the table to have four columns with automatic, i.e., residually determined, widths, you currently don't provide enough information for LaTeX to be able to determine ...
Mico's user avatar
  • 519k
6 votes

Position of the text within a table

If your table consists of multiple paragraphs and a mix of texts and pictures, the default alignment is always w.r.t. the first topmost baselines of each cell. For texts it is a bottom characters. For ...
Celdor's user avatar
  • 9,484
6 votes
Accepted

How can I draw inner vertical line centered in tabular?

You can use the w-column type from array package: \documentclass{article} \usepackage{multirow,array} \begin{document} \setlength{\extrarowheight}{1pt} \begin{tabular}{|c|w{c}{3cm}|w{c}{3cm}|} \...
Stephen's user avatar
  • 5,263
5 votes
Accepted

tabularx makes an unwanted line break

I would like to recommend that you rearrange the table's contents as follows: the contents of both columns should be organized as separate list-like environments, don't use vertical rules, but well-...
Mico's user avatar
  • 519k
5 votes

Position of the text within a table

You need to run the instruction \renewcommand{\tabularxcolumn}[1]{m{#1}} in the preamble, after loading the tabularx package. (The default setting is \newcommand{\tabularxcolumn}[1]{p{#1}}.) See ...
Mico's user avatar
  • 519k
5 votes

Shading part of a table

Here is a possibility with nicematrix \documentclass{article} \usepackage{nicematrix} \definecolor{copper1}{RGB}{203,109,81} \begin{document} \begin{NiceTabular}{llllllll}[hlines={1,3-11}] \...
Sandy G's user avatar
  • 46.8k
5 votes

Should an array eat up an explicit \mskip at the end of a column if tabularx is loaded?

tabularx is not involved here other than it loads array. In previous releases the mskip is removed but in 2024 that was fixed https://github.com/latex3/latex2e/issues/1323
David Carlisle's user avatar
4 votes
Accepted

Placing four tables next to each other within one big table with a caption on top and small captions below each small table

Something like this? \documentclass[10pt]{article} \textwidth= 5.00in \textheight= 7.4in \topmargin = 30pt \evensidemargin=0pt \oddsidemargin=55pt \headsep=17pt \parskip=.5pt % that'll be barely ...
Mico's user avatar
  • 519k
4 votes
Accepted

Nested tabularx inside a \newenvironment

tabularx gathers everything up to the next \end{⟨current environment⟩}, and the name of the current environment is set up by \begin{...}. Therefore, if you do only \newenvironment{MyTabular}{ \begin{...
campa's user avatar
  • 32.6k
4 votes

tabularx - column width multicolumn

Here is a solution with {NiceTabular} of nicematrix. \documentclass[a4paper, 11pt]{article} \usepackage[T1]{fontenc} \usepackage[czech]{babel} \usepackage[margin=2cm]{geometry} \usepackage{nicematrix,...
F. Pantigny's user avatar
  • 43.8k
4 votes
Accepted

tabularx: How do I format the first column of this table?

Since automatic line breaking isn't needed, I suggest you switch from a tabularx to a tabular* setup. No need for the adjustwidth sledgehammer. \documentclass{article} % or some other suitable ...
Mico's user avatar
  • 519k
4 votes
Accepted

\midrule, \bottomrule, etc do not extend until last columns of my table

You're attempting to use a tabularx environment but don't assign the X column type to any one of the 12 columns. You cannot possibly succeed in achieving the table's target width, viz., \textwidth. ...
Mico's user avatar
  • 519k
4 votes

tabularx makes an unwanted line break

I'm not sure where you found X<{\vspace{4pt}\hsize=#1\hsize}, but it's really wrong under many respects. The \hsize setup should be done at the beginning, not at the end. And \vspace{4pt} is doing ...
egreg's user avatar
  • 1.2m
4 votes
Accepted

Underfull \hbox (badness 10000) in a tabularx table

You might add \raggedright for the first column (and \centering for the other three), but you leave plenty of empty space. I don't think that equal width columns add to clarity for the table, so I ...
egreg's user avatar
  • 1.2m
4 votes
Accepted

Proper multi column spacing

With fixed width columns: \documentclass{article} \usepackage{array} \newlength{\blockwidth} \begin{document} \begin{table}[htp] \centering % local settings \setlength{\blockwidth}{0.5cm} \...
egreg's user avatar
  • 1.2m
4 votes
Accepted

How to put a line and a note under a certain column in tables?

Part of the issue with your code is that it specifies the table to have seven columns, while it has only six. This causes a noticeable "overhang" of the horizontal lines. Fixing this issue, ...
Mico's user avatar
  • 519k
4 votes

Position of the text within a table

The answer has already been given by @Mico, but you might benefit from the powerful tabularray \documentclass[10pt,letterpaper]{article} \usepackage[lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in]{...
JeT's user avatar
  • 3,662
4 votes

How can I draw inner vertical line centered in tabular?

with nicematrix \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}[width=0.6\linewidth]{cX[c]X[c]}[hvlines,cell-space-limits=2pt] \Block{2-1}{R} &...
polyn's user avatar
  • 5,919
4 votes

Adjust image width to occupy the entire width of a tabularx cell regardless of the width of the column

We need to find the absolute width of the first column. Let us work out the value of this length parameter from first principles. First, the instruction \begin{tabularx}{\textwidth}{ |>{\hsize=0....
Mico's user avatar
  • 519k
4 votes
Accepted

Table content is right aligned instead of left?

You're mixing and mismatching the machineries of the tabularx and tabular* environments. Either use the tabularx approach and start using the R column type (or, rather, the L column type), or switch ...
Mico's user avatar
  • 519k
4 votes

Shading part of a table

With tabularray package the code is short and simple: \documentclass[letterpaper,12.0pt]{report} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx} \definecolor{copper1}{...
Zarko's user avatar
  • 302k
4 votes
Accepted

Spacing and vertical lines on a tabularx

Professional quality tables don't use vertical rules, as explained in booktabs documentation, so, unless you're doing something special, I'd omit them. \begin{table}[ht!] \centering \begin{...
cfr's user avatar
  • 211k
4 votes
Accepted

Problem with multirow and long text

I would suggest to switch to tabularray, which does not allow multiline cells to overflow their cell borders. Also, it allows you to separate cells content from their appearance, so the code looks ...
Sergei Golovan's user avatar
4 votes

Suppress column already defined warning, tabularx, array

If you must, as for \newcommand, you can undefine the construct before making a new definition. \documentclass{article} \usepackage{array} \newcolumntype{u}{c} \ExpandArgs{c}\let{NC@find@u}\relax \...
David Carlisle's user avatar
4 votes
Accepted

How to change position of data values in the column of table

If you really want to mis-align your numbers, replace the nice S column with a left aligned column: \documentclass[10pt,twoside]{article} \usepackage[labelfont=bf, skip=5pt, font=small]{caption} \...
samcarter_is_at_topanswers.xyz's user avatar
4 votes
Accepted

Siunitx: spread table content accross page

Use tabular* instead. I made other changes, as you don't need threeparttable for this application. Also \textsuperscript{***} is not only a mouthful, but the output is really awful. Note also the ...
egreg's user avatar
  • 1.2m

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