Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
28 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{...
user avatar
  • 147
1 vote
0 answers
25 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{...
user avatar
1 vote
1 answer
58 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} \...
user avatar
  • 353
2 votes
2 answers
52 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$ & $...
user avatar
  • 21
0 votes
2 answers
86 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&...
user avatar
  • 38
0 votes
1 answer
30 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 ...
user avatar
  • 67
1 vote
1 answer
71 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} \...
user avatar
  • 656
0 votes
1 answer
125 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]. ...
user avatar
  • 7,079
1 vote
2 answers
124 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 ...
user avatar
1 vote
1 answer
70 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} \...
user avatar
  • 299
1 vote
1 answer
204 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 ...
user avatar
  • 8,759
0 votes
1 answer
69 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 ...
user avatar
1 vote
3 answers
81 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 ...
user avatar
1 vote
0 answers
24 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}, ...
user avatar
  • 6,217
0 votes
0 answers
26 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{...
user avatar
1 vote
1 answer
34 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 ...
user avatar
  • 656
1 vote
1 answer
39 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 ...
user avatar
0 votes
2 answers
102 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 ...
user avatar
  • 69
1 vote
1 answer
69 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} \...
user avatar
  • 1,201
2 votes
1 answer
513 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 ...
user avatar
1 vote
2 answers
74 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, ...
user avatar
1 vote
1 answer
89 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{...
user avatar
4 votes
4 answers
474 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
36 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 ...
user avatar
  • 1,337
1 vote
1 answer
87 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 ...
user avatar
  • 491
0 votes
0 answers
90 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,...
user avatar
  • 390
0 votes
1 answer
105 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}
user avatar
1 vote
1 answer
92 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{...
user avatar
  • 6,217
5 votes
3 answers
564 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{...
user avatar
2 votes
3 answers
160 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 ...
user avatar
4 votes
2 answers
105 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} ...
user avatar
  • 1,105
4 votes
2 answers
1k views

{NiceTabular} word wrap issue

I'm using NiceTabular from the NiceMatrix package and I'm having trouble with wrapping text within a cell. I've found that I've gotten the best results from background color using this package because ...
user avatar
  • 65
2 votes
1 answer
152 views

Vertical alignment of colored multirow

I want to center the multirow cells vertically, but because I need to color them aswell, I can't use \multirowcell from the makecell package as it is not compatible. Therefore, I used the shortstack ...
user avatar
  • 508
0 votes
2 answers
196 views

Globally styling vertical and horizontal rules in both tabular and longtable

I would like to change all the horizontal rules in all tables to be blue and all the vertical ones to be red by applying a .sty file. I cannot change the actual LaTeX markup of the tables themselves ...
user avatar
  • 101
1 vote
1 answer
170 views

Rowcolors in a longtable with three parts

I have a longtable inside a ThreePartTable environment and I want to have alternating row colors across page breaks. I want to have no color on the first row, since the header is also colored. The ...
user avatar
  • 508
1 vote
2 answers
366 views

How to remove blank spaces around table rules

I am trying to produce a colored table but the separation lines and the border lines are creating blank spaces that ruins the aesthetics of the table. I wish to remove them. Here is the code I'm ...
user avatar
0 votes
1 answer
37 views

Center text vertically in a table with multiple lines

I tried to improve the following table as can be seen in the screenshot below, the output is mostly what I want. Is there any reason the text is not centered vertically when it spans over multiple ...
user avatar
2 votes
4 answers
152 views

Problem with colortbl and makecell

Here is an simple example. \documentclass{article} \usepackage[table]{xcolor} \usepackage{colortbl} \usepackage{multirow, makecell} \begin{document} \begin{tabular}{c} longer text\\ \cellcolor{...
user avatar
  • 4,336
0 votes
1 answer
237 views

Fill mutirow cell when the horizontal lines are drawn with \hhline

When I fill the multirow cell whose horizontal lines inside the cell are drawn with \hhline{~}, there will be blanks, I try to fix it by >{\arrayrulecolor{gray}\doublerulesepcolor{gray}}=, but the ...
user avatar
  • 4,336
0 votes
0 answers
110 views

using self-defined colors with the colortbl package

If I want to use predefined colors to color rows with the colortbl package, it doesn't work: \documentclass{article} \usepackage{xcolor} \usepackage{color} \usepackage{array} \usepackage{colortbl} \...
user avatar
1 vote
2 answers
367 views

Color and style conflicts in table

So, I have a very simple table I'm trying to get working. The idea is to have the first, second, and last column/row separators be thick and colored a shade of green, while the first column and first ...
user avatar
  • 147
0 votes
2 answers
60 views

Extra gap between the columns in colored tables

Tables again. I want to color several rows in the table and use colortbl package. Everything works fine. Now I want to add extra gap between the first and the second column to make the table more ...
user avatar
1 vote
2 answers
231 views

Misplaced \noalign when working with tabular and tabularx and \hline

I am constantly getting the error "Misplaced \noalign" at the end of my tabularx. I already read a lot about it online for example that you need to put \\ before \hline. I did this but i am still ...
user avatar
0 votes
1 answer
122 views

Get current value of \arrayrulecolor for a colortbl

I want to define a special tabular environment and allow the user to specify the colors of the text and the rules independently of their values for a regular tabular environment. For the text color, ...
user avatar
4 votes
5 answers
487 views

Problem with highlighting a row in a table

I can highlight a row in a table (see below), but it's not centered on the text. Is there a way to fix this? Code: \documentclass[11pt]{article} \usepackage{color, colortbl,booktabs} \definecolor{...
user avatar
  • 201
2 votes
3 answers
136 views

Cellcolor covers alignment character in tabular

I'm aligning a range of numbers on an en-dash between two columns in a tabular. I'd like to add color to alternating groups of rows, but using \cellcolor covers up the en-dash. Note: this tabular is ...
user avatar
0 votes
1 answer
77 views

Two cells in one cellcolor argument

This is a follow-up to my previous question How to use cellcolor and double backslash - is there any way to do \documentclass{article} \usepackage{colortbl} \begin{document} \begin{tabular}{l} \...
user avatar
  • 35.9k
2 votes
2 answers
73 views

\columncolor in foreground if use \multirow

It seems that if I use >{\columncolor{green!30}}c and have \multirow content in that column, the color ends up in the foreground. The only difference in these two tables is that the second one has &...
user avatar
1 vote
1 answer
43 views

Remove horizontal rule in multicolumn table with colored background

I try to remove a horizontal rule in multirow / cellcolor setting: \documentclass{article} \usepackage{hhline,array,multirow,xcolor,colortbl} \begin{document} \parindent0pt \begin{tabular}{@{}|p{1cm}...
user avatar
  • 35.9k
0 votes
1 answer
189 views

Vertical line tabularx too long

I've seen this answer, and I've tried to reproduce it. My goal is to have all the table borders red and some of them thick. But the 2 first vertical lines span beyond the last horizontal rule, and I ...
user avatar
  • 1,935

1
2 3 4 5 6