Skip to main content

Questions tagged [colortbl]

{colortbl} is a package which implements a flexible mechanism for giving coloured ‘panels’ behind specified columns in a table. It requires the array and color packages.

Filter by
Sorted by
Tagged with
0 votes
1 answer
78 views

How can I make this table look nicer?

I am new to LaTeX and am trying to make a nice table. However, the best I can get is this: Does anybody have any improvements i can make? MWE: \begin{table}[h!] \begin{tabular}{|l|l|l|} \hline \...
Maths improver's user avatar
0 votes
1 answer
50 views

Clash of xcolor and colortbl over a longtable

The longtable below produces the following error: ! Undefined control sequence. \adl@@cr ...tempdima \xdef \adl@rowsL {\adl@rowsL (\adl@colsL /\...
Jelenak's user avatar
1 vote
2 answers
153 views

How to color a range of cells in a row in a table?

In the below code I have tried to redefine the \cellcolor command to achieve the effect of coloring a range of consecutive cells in a row by creating a command called \colorrow. It didn't work out. I ...
tonygrey's user avatar
  • 137
1 vote
4 answers
45 views

Iterate on set and use \rowcolor

I would like to generate the table contents with pure latex. My draft is as follows: \documentclass{article} \usepackage{expl3} \usepackage{colortbl} \definecolor{lightgray}{gray}{0.9} \ExplSyntaxOn \...
koppor's user avatar
  • 3,332
0 votes
0 answers
38 views

Why am I getting Black Cells in when using longtables?

I have the following code: \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{longtable, booktabs, colortbl} \title{test} \author{xyz} \date{May 2023} \begin{...
Unbuckle's user avatar
8 votes
3 answers
286 views

Why does the "\left [" partially disappear when I color a row in a table? But [ does not disappear

The problem is shown in the picture below: the tall left-hand square brackets that should be produced by \left[ and \begin{bmatrix} vanish. The code is as follows \documentclass{article} \usepackage[...
Darkhomo Van's user avatar
1 vote
1 answer
190 views

colortbl & dcolumn: Package array Error: Illegal pream-token (\tabpre): `c' used

While using the packages colortbl, dcolumn for the scenario described in MWE, I am getting the below error message: MWE: \documentclass{article} \usepackage{colortbl} \usepackage{dcolumn} \...
Kumaresh PS's user avatar
  • 1,267
1 vote
3 answers
121 views

rowcolor doesn't fill width with multicolumn + makecell for tabular

I'm creating a table. I need a cell that (1) spans 3 columns and (2) has multiple lines inside it; I will specify where the line breakings occur. Also, I want the row that contains that cell to be ...
Yosh's user avatar
  • 153
2 votes
1 answer
146 views

Horizontal tabular borders and `\arrayrulecolor` in beamer

When I tried implementing this answer in a previous question, I discovered a problem involving horizontal tabular borders and \arrayrulecolor. \documentclass{beamer} \usepackage{booktabs} %\cmidrule \...
user338955's user avatar
2 votes
3 answers
315 views

Table Cell colors have white gaps between them

I'm trying to set up a table for some results I got for some experiments. I was trying to recreate this table in my latex document (not exactly, but the general look of it). I'm 99% on the way there, ...
Tomas Premoli Muniagurria's user avatar
1 vote
1 answer
96 views

cellcolor leaves a blank space at the right of a multicolumn

Code: \documentclass[11pt]{article} \usepackage{xcolor} \usepackage{array} \usepackage{colortbl} \usepackage{multirow} \usepackage{makecell} \renewcommand\arraystretch{1.5} \begin{document} \begin{...
SpeedJack's user avatar
4 votes
3 answers
194 views

Problem with rowcolors and @{} in tabular environment

I would like to insert the \pm symbol between a pair of numbers on each line of a table. I would like to alternately color the rows. I tried to use the rowcolors package but this overwrites the ...
democritus's user avatar
1 vote
1 answer
57 views

Provide value-dependent color to \cellcolor command

I would like to create a table-based heatmap. The answer https://tex.stackexchange.com/a/175035/70170 looks like what I need, but instead of three fixed colors, I'd like to call \cellcolor{} with a ...
Hanno's user avatar
  • 155
3 votes
1 answer
87 views

Conflict between minted, colortbl and multicolumn (insertion of code in array cells)

I am doing a table, where some cells contain code. I also want to color some cells. It is perfectly allowed to use minted inline code inside table cells. However, I can't use minted code in a ...
banban's user avatar
  • 33
3 votes
2 answers
127 views

Paint columns of multirows latex

I'm trying to coloring a table with multirows. I want to "Formação Candeias" cell to be gray, "Rifte" cell to be pink and "Pré-rifte" cell to be blue. Below I'll show my ...
Annie Gabrielle's user avatar
2 votes
3 answers
113 views

Can't format the table correctly (\hline and colored cells)

I've created this table using a table converter website online and then tweaking it until I got what I wanted. I am using overleaf to compile everything. \begin{table}[h!] \caption{Composition of the ...
Flor's user avatar
  • 31
1 vote
3 answers
173 views

colortbl: why does a double vertical line interrupt the background color?

Feeding \documentclass{standalone} \usepackage{colortbl} \begin{document} \(\begin{array}{l|l|l||l|l|l} \rowcolor[gray]{.9} 11 & 12 & 13 & 14 & 15 & 16\\ 21 & 22 &...
user avatar
1 vote
1 answer
117 views

Table: Color, alignment, and linebreak in cells

Code Consider the following code. \documentclass[ 12pt, landscape ]{article} \usepackage{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[ a3paper, margin = 0.77cm ]{...
Svend Tveskæg's user avatar
1 vote
2 answers
375 views

Table Background color with toprule

I want make a table with background color, when I am using \toprule,\midrule and \bottomrule I have a white space after the rule. I want to fill the color of rule below space. MWE is below \...
murugan anbu's user avatar
0 votes
1 answer
185 views

\CodeBefore isn't recognized in the pNiceMatrix environment

When I try the following M(n)WE (copied almost verbatim from the nicematrix manual): \documentclass{article} \usepackage[table]{xcolor} \usepackage{nicematrix} \begin{document} \[ \begin{...
pelegs's user avatar
  • 267
1 vote
0 answers
28 views

below space not coming correctly using colortbl.sty and rowcolor

My codes are: \documentclass[executive,twoside, justified, symmetric, notoc,openany]{tufte-book} \usepackage{booktabs} \usepackage{longtable} \usepackage{colortbl} \usepackage{setspace} \usepackage{...
GowriSaro's user avatar
  • 572
1 vote
1 answer
99 views

Table with tcolorbox doesn't work correctly

I define mytables using tcolorbox, but doesn't work. \documentclass{book} \usepackage{array,tabularx} \usepackage[table]{xcolor} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{tcolorbox} \...
niksirat's user avatar
  • 617
2 votes
2 answers
236 views

Created two tables in Latex, but they're spread far apart . How do I move them closer together so there isn't so much blank space?

\begin{document} \textbf{2b. } \definecolor{Cyan}{rgb}{0.88,1,1} \begin{table} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline p & q & r & $\neg p$ & $\neg q$ & $\neg r$ & $...
Crimson's user avatar
  • 21
0 votes
2 answers
524 views

How to define table cell color depending on cell text value imported from the CSV file

I am trying to color table cell depending on the text value imported from the CSV file. The CSV file has three possible text values that are "High", "Intermediate" and "Low&...
c_bfx's user avatar
  • 48
0 votes
1 answer
71 views

Error when add align inside of tabular of beamer

I've tried to add \begin{align} ... \end{align} inside of my tabular. This is my reference align inside of tabular. But, when I try the code on that link in beamer, i get a message like this ...
Ari's user avatar
  • 67
1 vote
1 answer
132 views

Problem using arrayrulecolor and compiling with make4ht

The following example crashes when compiling with make4ht The problem relies on the usage of \arrayrulecolor. \documentclass{article} \usepackage{booktabs,colortbl} \begin{document} \begin{table} \...
LEo's user avatar
  • 772
0 votes
1 answer
230 views

Applying rowcolor to tabularx in spreadtab causes "TeX capacity exceeded" error

Trying to apply \rowcolor{gray} to a specific row of a tabularx table whose values are calculated from spreadtab causes the famous error TeX capacity exceeded, sorry [parameter stack size=10000]. ...
Pouya's user avatar
  • 7,319
1 vote
2 answers
588 views

Revtex4-2 tabular Table with alternating colors rows formatting issues

Description of issue I would like to make a table like the following in a LaTeX document that uses revtex4-2 as its document class: However, the table that I generate with LaTeX has a bunch of white ...
Avi Vajpeyi's user avatar
1 vote
1 answer
183 views

Very thin white lines in \fcolorbox

I see \fcolorbox making very thin white lines between the border of a box and the dark background and at the corners of the border. Here is an example: \documentclass{article} \usepackage{colortbl} \...
chan1142's user avatar
  • 319
1 vote
1 answer
482 views

Understanding how \rowcolors work with longtables

For the following, I would like to understand: What is the first row considered by colortbl? The header or that one with numbers 1 & 2? Why doesn't the coloring respect \rowcolors{3} and skip ...
Diaa's user avatar
  • 9,689
0 votes
1 answer
86 views

How to get a table without internal justification of the text and that fits on the sheet?

The table distorted with unjustified text that does not fit the size of the sheet. In the table the text of the multi-row cell is not justified, in addition, the table has to distort the size of the ...
Reyes Reyes Emerzon's user avatar
1 vote
3 answers
529 views

\cellcolor overrides borders even with \hhline, how do I fix?

Here is a minimal working example of my code. When I compile it using overleaf online TeX editor I get the expected result and everything works fine, while when I compile it using texstudio here is ...
Baffo rasta's user avatar
1 vote
0 answers
26 views

pgfplotstable: color from cellentry ##1 [duplicate]

If I have a column with entries like 0,0,red,0,green,0,0,0,brown,0,0,0,..., why does this not work: postproc cell content/.code={ \ifnum##1=0 \else @cell content={cellcolor{##1}{##1}} \fi}, ...
cis's user avatar
  • 8,912
0 votes
0 answers
33 views

Remove non-colour space between multirow cells in table

I'm creating a longtable with a number of coloured cells and some cells split into multirows, using rmarkdown: --- header-includes: - \usepackage{pdflscape} - \usepackage{longtable} - \usepackage{...
Mark Davies's user avatar
1 vote
1 answer
60 views

tex4ht and colortbl creates a misplaced \noalign error

It seems to be a problem still not solved (related to question 311689 and 73508). The usage of colortbl package with tex4ht causes the error: Misplaced \noalign. Here is a short example to reproduce ...
LEo's user avatar
  • 772
2 votes
2 answers
60 views

xcolor `table' options clears part of the hhline command output

When I use table option for xcolor package or use colortbl package, it clears part of the hhline (red border in below picture)! How can I fix this problem? When I remove table option, the output is ...
Bahman Mirzakhani's user avatar
0 votes
2 answers
361 views

Remove horizontal padding from nested tabular tables

Update Both David Carlisle's and Skillmon's answers were great (and posted within 10 seconds of each other), but SO would only let me mark one as correct, so I encourage anyone encountering this ...
SKNB's user avatar
  • 169
1 vote
1 answer
213 views

Fix background cellcolor to match the borders

How can I fix the booktabs borders to match the cell color or vice versa? \documentclass{article} \usepackage[normalem]{ulem} \usepackage[svgnames,table,xcdraw]{xcolor} \usepackage{booktabs} \...
OOzy Pal's user avatar
  • 1,571
3 votes
1 answer
1k views

Persistent error ‘Undefined control sequence. \cellcolor’ with 'colortbl' LaTeX package

I've had a persistent error that appears with the following MWE (generated using TablesGenerator.comand tested with Texpad). The error ‘Undefined control sequence. \cellcolor’ does not appear to be ...
RosesBouquet's user avatar
1 vote
2 answers
235 views

Creating a Table fitting the line width and without thin white vertical lines between color filled cells

Can some help me making the table coded in this Thread https://tex.stackexchange.com/a/301036/229635 fit the line width? As a MWE I copied the code from the Thread I attached as a link. Thanks a lot, ...
Benson_G's user avatar
1 vote
1 answer
181 views

How to put tablet formats in correct way

I tried to make one table in LaTeX however my code doesn't work, do have any idea to solve this? \usepackage[utf8]{inputenc} \usepackage{multirow} \usepackage{colortbl} \usepackage{arydshln} \begin{...
Naldo Chavez's user avatar
4 votes
4 answers
2k views

Coloring whole row in table/tabular

I would like to color the entirety of the row "Trail 1" and "Trail 3", other than those words themselves (ie just the numbers, but the coloring runs from the \midrule to the next). ...
user avatar
2 votes
1 answer
42 views

Tabularx and colortbl conflict inside a savebox

My overall goal is to build a table inside a savebox so I can easily fill the page with multiple copies. Someone recommended using tabularx, which worked well until I also tried to use the colortbl ...
HTG's user avatar
  • 1,377
1 vote
1 answer
170 views

How to manage color lines in tables?

I've created a table using the website: https://www.tablesgenerator.com/, but I've a problem with some lines. How can I delete white lines in the first column of the following table (the ones ...
g_don's user avatar
  • 809
0 votes
0 answers
97 views

Highlighted column and row not working. How to resolve it?

I need to highlight some columns and rows in the table. But the following code is not working. So kindly help me to resolve the issue. I am using miktex with winedt. Thank you. \documentclass[CEJMed,...
Jai Kumar's user avatar
  • 390
0 votes
1 answer
143 views

How could I know the result color when I mix the color numbers? [closed]

In these codes, how can i select a special color from them? \definecolor{mypink1}{rgb}{0.858, 0.188, 0.478} \definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412} \definecolor{Mycolor2}{HTML}{00F9DE}
Mamoun Mohammed's user avatar
2 votes
1 answer
172 views

pgfplotstable: How to use the read out row- (column-) value for styles

I want to color a row (column) from a cell with special content, e.g. 'x'. I tried to use every nth row={\rememberrow}{before row=\rowcolor{orange}}, % WORKS NOT! in the solution. \xdef\remembercol{...
cis's user avatar
  • 8,912
5 votes
3 answers
1k views

Adding arrayrulecolor command removes top rule

The code below results in the image below. \documentclass{beamer} \usetheme{Montpellier} \usecolortheme[named=gray]{structure} \usepackage{colortbl} \usepackage{array} \newcommand{\gr}[1]{\textcolor{...
JRN's user avatar
  • 304
2 votes
3 answers
374 views

color overhang with rowcolors in a table

I load xcolor with option table, to get alternating row colors However, I can't remove the color padding before the text of the first column (when using @{}. In xcolor documentation, I see options for ...
PlasmaBinturong's user avatar
4 votes
2 answers
334 views

Coloring a line of a table

I try to color only the first line of the table below, using the code: \documentclass{article} \usepackage{makecell} \usepackage{hhline} \usepackage{xcolor} \usepackage{colortbl} \usepackage{tabularx} ...
Cris's user avatar
  • 1,201

1
2 3 4 5 6