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
\...
8
votes
Accepted
Problem with table - \tabular vs \tabularx
Unlike the tabular* and tabularx environments, the tabular environment does not take a target width as one of its arguments.
And, while employing the line-drawing macros of the booktabs package, one ...
7
votes
Accepted
Generate simple table (with foreach?)
\foreach cannot straddle table cells.
Here's a version that works.
\documentclass[letterpaper,oneside]{article}
\usepackage{array}
\ExplSyntaxOn
\NewDocumentCommand{\makerows}{mm}
{% #1 = number of ...
7
votes
How do I make this table better looking?
I'd like to suggest that you start by getting rid of all vertical rules and most horizontal rules. Next, use the macros \toprule, \midrule, \addlinespace, and \bottomrule instead of \hline, as is done ...
7
votes
font color does not work in front of S column of `siunitx`
Switching from tabularx to the more adaptable tabularray solved the problem neatly. The transformed code is:
\documentclass[varwidth, margin=10pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[...
6
votes
Custom table with tabularx and multicolumns and multirows
I have a working (not perfect) code that done this output:
The code:
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tabularx} % in the preamble
\usepackage{...
6
votes
LNCS: Large table in sidewaystable
You'll need to insert line breaks in almost all header cells. Since most of the headers appear to be acronyms, it's best to force the line breaks by hand; see the code below for how this may be done. ...
6
votes
LNCS: Large table in sidewaystable
No sidewaystable if you avoid lengthy repetition.
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\title{Paper Title Here ... }
\begin{table}[htp]
\caption{...
6
votes
How to draw \hline which does not cross a cell gotten by merged ones?
As mentioned @Teepeemm in his comment, instead of \hlines you should use \cline{2-3}. Or instead of tabular table use tblr of tabularray package:
\documentclass[margin=3mm,varwidth]{standalone}
\...
6
votes
font color does not work in front of S column of `siunitx`
First of all, I think a problem of your code is that you place the $\times$ inside a \savebox which essentially prevents the contents from being affected by \color settings outside of this box. I ...
6
votes
Accepted
column widths when using multicolumn
You defined 4 columns but your table has only 3.
\documentclass{article}
\usepackage[margin=2cm,a4paper]{geometry} % set page parameters suitably
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\...
6
votes
Accepted
What should the table do when using multicolumn multiple times?
There are two syntax errors in your code. To get rid of them, you need to
remove the & particle from \multicolumn{3}{c}{D} &\\
not alternate between \cline directives and column contents. ...
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 ...
5
votes
Custom table with tabularx and multicolumns and multirows
This works:
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tabularx} % in the preamble
\usepackage{multirow}
\usepackage{geometry}
\geometry{
a4paper,
%...
5
votes
Accepted
Table row to fill entire page
A solution using nicematrix, probably a bit complicated. It uses TikZ to measure the height of a row which is relatively easy, because the package adds TikZ coordinate to the cells. This way, you can ...
5
votes
Accepted
Custom table with tabularx and multicolumns and multirows
tabularx table should has at least one column of X or from it derived type
if some columns should have different width, you can define ratios between them or write some columns as p{<width>} or ...
5
votes
Accepted
Table Cell colors have white gaps between them
A solution using the tabularray package (Q[co=1] is synonym for the X column type):
\documentclass{article}
\usepackage{geometry}
\usepackage{xcolor, tabularray}
\UseTblrLibrary{siunitx}
\begin{...
5
votes
Table Cell colors have white gaps between them
Here's slightly altered version of your code based on colortblr.
Notice, I have loaded hhline package to avoid a problem with \cline.
\documentclass{article}
\usepackage{geometry}
\usepackage{array,...
5
votes
Table Cell colors have white gaps between them
Here is a solution with {NiceTabular} of nicematrix. You need several compilations.
You won't see thin white lines, whatever PDF you use, whatever level of zoom.
\documentclass{article}
\usepackage{...
5
votes
Accepted
Table with height an exact multiple of constant
Here's another example based on saved boxes--the way to obtained the current height of multiple multi lined paragraphs.
I have used a little different approach to build a long table based on longtblr ...
5
votes
Two large figures side by side
This uses a combination of saveboxes and \parboxes. The captions are placed in \parboxes to control the width (minipages will do just as well). The \nulls prevent \abovecaptionskip from geing ...
5
votes
tabularx and multicolumn: column width is not correct
You asked,
Am I doing something wrong?
Short answer: Yes.
Slightly longer answer: Your tabularx environment contains too many mutually conflicting pieces of information; the result is a mess that ...
5
votes
Need to expand table to fit hsize
You really need to stop engaging in so much visual formatting. Do yourself a favor and take the time to learn how to use the \ce macro, which is provided by the mhchem package, to typeset chemical ...
4
votes
Table row to fill entire page
This uses a savebox to measure the tabular without the notes, then uses a strut (\ruie{0pt}{...}) instead of \vspace.
\documentclass[]{article}
\usepackage{tabularx}
\usepackage{showframe}
\newlength{...
4
votes
Table row to fill entire page
you could combine with tcolorbox and draw some of the lines with overlay (here the dotted line):
\documentclass[addpoints,12pt,a4paper,dvipsnames]{exam}
\usepackage{setspace}
\usepackage{lipsum}
\...
4
votes
Custom table with tabularx and multicolumns and multirows
tabularx provides X-type column, which adapts its width to the table. I would additionally suggest to define a custom column e.g. Y to avoid unnecessary repetition
\newcolumntype{Y}{>{\centering\...
4
votes
Accepted
How to make the width of the columns in the table equal?
Like this?
Edit:
In your MWE are not present contents of lower part of table, so in the following example considers only data in the upper part of table.
The screenshot shows that the numbers in the ...
4
votes
Accepted
Text not vertically aligned in tabularx cell
I'm afraid that ghsystem should be updated, because with TeX Live 2022 (but also 2021) it tries to do
\chemmacros_load_module:n {nomenclature}
but chemmacros in its most recent versions uses \...
4
votes
Auto alignment parentheses in LaTeX tabular
The output is not messy if you enlarge the \baselineskip register. For example:
\def\crl{\crcr\noalign{\medskip\hrule\medskip}}
\vbox{\baselineskip=17pt \halign{&\ \hfil$#$\hfil\ \cr\crl
\rm ...
4
votes
How to draw \hline which does not cross a cell gotten by merged ones?
With {NiceTabular} of nicematrix.
\documentclass[margin=3mm,varwidth]{standalone}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{ccc}[hvlines]
col1 & col2 & col3 \\
\...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tabularx × 2228tables × 1321
longtable × 144
multicolumn × 139
vertical-alignment × 132
horizontal-alignment × 130
multirow × 122
spacing × 61
booktabs × 58
color × 55
tikz-pgf × 52
siunitx × 49
ltablex × 49
width × 45
environments × 44
line-breaking × 44
formatting × 43
captions × 41
columns × 41
tabulary × 36
threeparttable × 35
itemize × 34
floats × 33
alignment × 33
align × 32