New answers tagged tables
0
votes
Top Vertical Alignment with Multirow
Here is a solution with {NiceTabular} of nicematrix.
\documentclass{article}
\usepackage{booktabs,fullpage}
\usepackage{nicematrix,tikz}
\begin{document}
\begin{center}
\begin{NiceTabular}{c>{\...
1
vote
Advice for creating a clean table with tabularray
My main recommendation would be to transpose the table, because it's easier to scan down a column and compare values than it is to scan across a row. I also moved "capacity" into the ...
1
vote
Advice for creating a clean table with tabularray
Firstly, thank you so much for the help, everyone. That was almost instantaneous feedback. Really appreciate it.
I've actually gone with the design suggested by Skillmon.
I rebuilt the "compact&...
0
votes
Latex partially colored makecell in table
With {NiceTabular} of nicematrix.
\documentclass[12pt]{scrartcl}
\usepackage{xcolor}
\usepackage{nicematrix}
\begin{document}
\begin{table}
\centering
\begin{NiceTabular}{c|c|c|c}
\...
1
vote
Color merged and regular cells in a table individually
A tabularray implementation.
Full code
\documentclass[margin=2mm]{standalone}
\usepackage{tabularray}
\usepackage{xcolor}
\begin{document}
\begin{tblr}{
colspec={ *{4}{Q} },
cells = { halign=c,...
3
votes
Accepted
Latex partially colored makecell in table
Instead of using makecell you could nest a tabular with only a single c-column in that cell:
\documentclass[12pt]{scrartcl}
\usepackage[table,xcdraw]{xcolor}
\begin{document}
\begin{table}
\...
1
vote
Answermatrix for Exam // Table/Matrix with fixed width and height independent of the content
I do not have a perfect solution, but it works for most parts. I was not able to do it without additional commands in the table. I needed to define these two commands to either always show the content ...
2
votes
LateX very long table fit width
Please, do yourself a favor and clean up your preamble: loading packages twice or more is just confusing, even more if you load them with contradictory options (look at geometry). Notice that subfig ...
2
votes
Empty tabular for worksheet
By use of the tblr of tabularray package:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{colspec= { c *{3}{X}},
rows = {ht=3ex},
hlines, ...
3
votes
LateX very long table fit width
The class column is really repetitive; you'll save a lot of room if you can figure out a way to convey that information some other way. Here, I've moved it from a column to being its own row (except ...
3
votes
Accepted
Table incorporated inside a longtable cell
It seems that you generate code for your table with some on-line generator. Consequently table code is big mess and full of clutter. Also it is unclear what your table should looks.
Beside ...
4
votes
LateX very long table fit width
You load package xltabular, so why not use that. With 2 X columns you get a decent layout.
You should remove the inner tabular environments, and replace the \\ inside these with \newline, otherwise it ...
3
votes
Tables: header fill with multirow
One more answer using tabularray package with using amsmath and booktabs libraries.
Regarding booktabs rules: they have small amount vertical space around rules (as you observe as white space), ...
4
votes
Tables: header fill with multirow
I'm writing my thesis and I'd like to include some good-looking tables.
Start by removing \multirow, color and boldface. The main headers should be on the same line. Multirow cells are ambiguous; ...
8
votes
Tables: header fill with multirow
Here is an implementation of your table using the tabularray package.
As for the packages you've loaded:
\usepackage[utf8]{inputenc} is no longer needed since 2018, so you can safely remove it [...
4
votes
Accepted
Tables: header fill with multirow
In your example, I have loaded nicematrix (unloaded colortbl) and replaced your environment {tabularx} by {NiceTabularX} of nicematrix.
I have directly the expected output (after several compilations)....
1
vote
How can Booktabs \toprule and \bottomrule be lengthened?
Since you're not using any columns of type X, there's no point in using a tabularx environment to begin with.
You can automate the centering of a tabular environment that's wider than \textwidth by ...
6
votes
How can Booktabs \toprule and \bottomrule be lengthened?
Your example
\documentclass{article}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{tabularx}
\begin{document}
\begin{table*}[]
\footnotesize
\caption{A Table Caption}
\hspace*{-3cm}
\...
1
vote
blank space is showing on bottom of some pages in report
When you're typesetting your document with oneside mode LaTeX uses \raggedbottom (meaning that pages don't have to end on the same height).
You can change that by invoking \flushbottom in your ...
7
votes
Advice for creating a clean table with tabularray
My goal with tables is always to minimize repetition and make them as clear and straightforward as possible.
% 'standalone' class used just to visually isolate the problem
\documentclass[preview, ...
4
votes
Advice for creating a clean table with tabularray
An alternative tblr of tabularray package table. I would use X columns type and package mhchem chem formulae for hydrogen.
\documentclass{article}
\usepackage{caption}
\usepackage[version=4]{mhchem}
\...
6
votes
Accepted
Advice for creating a clean table with tabularray
Full width versions
I'd put the two different measurements into separate rows, also I'd get rid of all except 3 of the horizontal rules. I'd also drop the parentheses around the second measurement of ...
4
votes
Advice for creating a clean table with tabularray
I suggest to:
use fixed width columns for columns 2-5 and an X column for the first column. This way, tabularray can add line breaks to your texts and also adjust the width of the whole table to ...
1
vote
Accepted
REnewcolumntype to surpress warning when using newcolumn to redefine a column
You can deactivate \PackageWarning:
\documentclass{article}
\usepackage{array}
\NewCommandCopy{\RealPackageWarning}{\PackageWarning}
\newcommand*{\DeactivatePackageWarning}{\renewcommand*{\...
3
votes
REnewcolumntype to surpress warning when using newcolumn to redefine a column
just as you can let a command to \relax to avoid an error from \newcommand you can do the same here.
\documentclass{article}
\usepackage{array}
\newcolumntype{\examplecolumn}{}
\ExpandArgs{c}\let{NC@...
6
votes
Accepted
Is it possible to manipulate or transform the input within an environment?
You can loop:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{counter}
\ExplSyntaxOn
\NewDocumentEnvironment{chessmoves}{b}
{
% split the environment's contents into items at the \...
4
votes
Is it possible to manipulate or transform the input within an environment?
You can use \SplitList argument processor, together with the \ProcessList command
\NewDocumentEnvironment{chessmoves}{ >{\SplitList{/}} +b }{%
\ProcessList{#1}{\typesetmove}
}{}
Here I use / to ...
2
votes
Is it possible to manipulate or transform the input within an environment?
This might serve as a starting point.
\documentclass{article}
\usepackage{environ}
\usepackage{tabularray}
\UseTblrLibrary{counter}
\newcounter{moveno}
\newcommand{\moveno}{\stepcounter{moveno}\...
5
votes
The first row in a tabularray does not start at 1
Like this?
For numbering I would use tblr option:
cell{2-Z}{1} = {cmd=\the\numexpr\arabic{rownum}-1.},
Beside this I would no insert table in `adjustbox7. Beter and more coesistent is to determine ...
3
votes
The first row in a tabularray does not start at 1
Tabularray does count the header row as a row, so the counter is workings as intended. However you can define a new command to print rownum - 1 as follows:
\newcommand{\Rownum}{\inteval{\value{rownum}-...
3
votes
Centering Images and text inside a table
Another possible approach with the tabularray package in combination with adjustbox:
\documentclass{article}
\usepackage{caption}
\usepackage{tabularray}
\usepackage[export]{adjustbox}
\usepackage{...
3
votes
table with images
Like in your other question, I'd use tabularray. This makes it not only easy to centre the images, but also to adjust the relative column widths:
\documentclass{article}
\usepackage{geometry}
\...
3
votes
How to label lines and columns of a matrix?
No extra package is needed. TeX can do it, as suggested by mickep:
\documentclass{article}
\begin{document}
\[
\bordermatrix{
& C & D \cr
C & b-c & -c \cr
D ...
3
votes
How to label lines and columns of a matrix?
A solution with spalign package:
\documentclass[12pt]{article}
\usepackage{spalign}
\begin{document}
\[
\def\spalignendline{\cr}
\spalignrun{\bordermatrix{\the\spaligntoks}}
{, C D;
C b-c -c;
D b 0
}
...
2
votes
Creating tables dynamically
You can't use \foreach to span columns.
I'd define a general purpose \stepdo command, that we can apply in the specific case. The last argument is a template where the current value in the loop is ...
3
votes
How do I vertically center the cells in specific columns of a table?
I'd use tabularx and no nested tabular: just help LaTeX to state points where lines must be broken and add ties for things that should not be broken across lines.
I use a devious trick in order to get ...
2
votes
How do I vertically center the cells in specific columns of a table?
I recommend that you employ a tabularx environment instead of a tabular environment and use the package's X column type for column 2. That way, you can let LaTeX perform any needed line-breaking ...
6
votes
How do I vertically center the cells in specific columns of a table?
I've recreated your table using the tabularray package, which provides significantly more versatility for your requirements. While I personally avoid using vertical lines in tables, the decision is ...
6
votes
How do I vertically center the cells in specific columns of a table?
If you use \begin{tabular}[t] you force the tables to be top aligned. If you don't want them to be top aligned, don't add use the t option (or if you must use the optional argument, replace it with c ...
5
votes
Accepted
Creating tables dynamically
\foreach of pgffor creates a TeX group which interferes with the & of the tabular.
I suggest to use \int_step_inline:nn for the loop. In order to use that command of the L3 programming layer, you ...
2
votes
Latex code for tabular method of convolution
If you actually want to construct your table with such design (maybe not a good idea: see other answers), here is a way with nicematrix.
\documentclass{article}
\usepackage{nicematrix}
\begin{...
3
votes
Latex code for tabular method of convolution
With tabularray ans spreadtab.
Like a spreadsheet, we copy the formula to the right and below with
& -1 & 2 & 0 & 1\\
3 & \STcopy{>,v}{!a3*b!2}&&...
1
vote
Accepted
Images in table alignment
You can use the valign=c option from adjustbox to centre your images vertically:
\documentclass{article}
\usepackage{tabularray}
\usepackage[export]{adjustbox}
\usepackage[hmargin=2cm]{geometry}
\...
5
votes
Accepted
table with images
Here's a solution that employs the xltabular package and eponymous environment. Basically, xltabular combines the capabilities of longtable (allow page breaks in the table) and tabularx (set a target ...
5
votes
Latex code for tabular method of convolution
Here is another idea to present the information which avoids the slash and uses only standard commands.
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{tabular}{rl}
& $\...
1
vote
Multirow in table bigger than single rows
I suggest you use nested matrix and pmatrix environments. No need to fiddle with \multirow directives. And, by using \midrule and \bottomrule, two macros provided by the booktabs package, one can meet ...
4
votes
Latex code for tabular method of convolution
The typographic quality of that table is really poor. The slash is to be avoided as it doesn't really make clear what the entries refer to.
\documentclass{article}
\usepackage{booktabs,siunitx}
\...
7
votes
Latex code for tabular method of convolution
Here's a quick and easy solution using the tabularray package:
Here's the code:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\begin{document}
\(
\begin{tblr}{
hline{...
5
votes
Latex code for tabular method of convolution
The following implements your table, but it doesn't use the diagonally split cell for the header (because I don't like the looks of it), if you absolutely have to have this, you can use diagbox to ...
3
votes
Multirow in table bigger than single rows
Like this?
Instead of tabular package I would rather use tblr of tabularray package on the following way without use of multi row cells:
\documentclass[margin=3mm]{standalone}
\usepackage{tabularray}
...
Top 50 recent answers are included
Related Tags
tables × 18345tabularx × 1377
horizontal-alignment × 1079
longtable × 1069
vertical-alignment × 938
multirow × 875
multicolumn × 832
spacing × 691
captions × 621
floats × 603
color × 561
formatting × 553
tikz-pgf × 506
siunitx × 460
columns × 370
booktabs × 367
graphics × 354
beamer × 343
macros × 289
rotating × 289
align × 264
width × 259
alignment × 233
math-mode × 230
line-breaking × 230