12 votes
Accepted

Why is the start row of \rowcolors ignored in tabularx?

Obviously tabularx doesn't have bugs, this is a documented feature. TX sets the table several times, and restores latex counters but tex primitive counters can not be restored so easily. This defines ...
David Carlisle's user avatar
10 votes
Accepted

Table xcolor @{,} \rowcolor broken text

Sorry blame the author of colortbl not xcolor the interface here is rubbish, however you can do this: \documentclass[a4paper,10pt]{report} \usepackage[table]{xcolor} \begin{document} ...
David Carlisle's user avatar
9 votes
Accepted

Misplaced noalign when using rowcolor

You need to keep the colour restore within the noalign so need {} but colortbl allows you to colour \hline, so do you need this? \documentclass{article} \usepackage{color, colortbl} \begin{document}...
David Carlisle's user avatar
9 votes
Accepted

Does something like \rowcolors exist for groups of rows?

I have taken a look at the code for \rowcolors and adapted it to allow groups greater one. The new command \groupedRowColors takes four mandatory and one optional argument: The first mandatory ...
jakun's user avatar
  • 5,941
8 votes
Accepted

\rowcolor overwrites column divider

That's weird, and if we're lucky, David Carlisle of the colortbl package will stop by and clarify this. I'm not adept enough to go under the hood and fix the z-order of the rules vs fill color, which ...
Menger Sponge's user avatar
8 votes

Table xcolor @{,} \rowcolor broken text

An practical alternative: To write decimal numbers alegned at decimal mark you can use two packages: dcolumn siumitx With both you simple merge r andl column in one and numbers write as ordinary ...
Zarko's user avatar
  • 296k
8 votes
Accepted

Row colour gaps in tabularx with \aboverulesep and \{}

One of possibilities is to use cellspace package: First the vertical space around booktabs rules i reduced to zero pt, than is increased by macro \cellspacetoplimit and \cellspacebottomlimit to ...
Zarko's user avatar
  • 296k
8 votes
Accepted

tabularray alternate line color, but do not color first column (ignore first column)

No need to use column{1} = {white} or cell{1-Z}{1} = {bg=white}, they are dirty hacks! The correct way is to set cell{even[4-Z]}{2-Z} = {lightgray}, that means even cells from the 4th row to the last ...
CarLaTeX's user avatar
  • 62.2k
7 votes

How to get rid of vertical white lines in a table?

I suggest you get rid of all vertical lines and most \hline instructions. The mysterious whitespace next to some vertical lines will disappear automatically. Plus, the vertical lines aren't needed ...
Mico's user avatar
  • 503k
7 votes

Rowcolor, Multicolumn, and Tabu

Another option would be the new tabularray package. The package allows you to completely separate the format from the content. It support cells spanning multiple columns and rows and coloring. \...
marv's user avatar
  • 2,099
7 votes

how can shading rows in table

Here is solution with {NiceTabular} of nicematrix. \documentclass[english]{article} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{c*{3}{|wc{1cm}}}[cell-space-limits=3pt,color-inside,...
F. Pantigny's user avatar
  • 39.7k
6 votes
Accepted

csvsimple vs. conditional row coloring

Your error stems from \rowcolornot being at the very beginning of the row. You can fix that by adding an additional \\ at the beginning of a row. It would also be better to use a filter (section 3.4 ...
DG''s user avatar
  • 21.7k
6 votes
Accepted

Color issue with the combination of the longtable, rowcolor, and makecell

You can avoid the problem by using longtblr from the tabularray package: \documentclass[a4paper]{article} \usepackage[table]{xcolor} \definecolor{lightblue}{rgb}{0.93,0.95,1.0} \usepackage{tabularray}...
samcarter_is_at_topanswers.xyz's user avatar
5 votes

How to set text color and font type of header row for all tables in LaTeX?

This is something where ConTeXt really shines. Observe how the actual table content contains zero visual markup \setupTABLE [row][first] [background=color, backgroundcolor=darkgreen, color=...
Henri Menke's user avatar
5 votes

How to set text color and font type of header row for all tables in LaTeX?

I propose to define new column types, L , C, R, which incorporate the font and text colour changes only if we're in first row, since the [table] option of xcolor defines a \rownum counter: \...
Bernard's user avatar
  • 271k
5 votes
Accepted

I need rows colored alternatively but in doubles

A possible solution is to use \hiderowcolors/\showrowcolors: \documentclass[12pt]{article} \usepackage[ paperwidth=8.27in, paperheight=11.69in]{geometry} \usepackage{booktabs, siunitx} \usepackage[...
CarLaTeX's user avatar
  • 62.2k
5 votes

rowcolor removes the vertical lines of the table

Another option would be the new tabularray package (CTAN). It has the command \SetRow which you can use to modify all properties of the current row, including color. Using that, vertical lines appear ...
marv's user avatar
  • 2,099
5 votes
Accepted

How to get rid of vertical white lines in a table?

Without makecell but with a modified m type column for the first column, the small white space there disappears: \documentclass[11pt, a4paper]{scrbook} \usepackage[left=27.5mm,right=16mm,top=30mm,...
leandriis's user avatar
  • 62.6k
5 votes

How can I to do this?, but with lines join

With the help of hhline instead of booktabs: \documentclass{article} \usepackage[table]{xcolor} \usepackage{hhline} \newcommand{\nocell}{\multicolumn{1}{r}{}} \begin{document} \begin{table}[htbp] ...
leandriis's user avatar
  • 62.6k
5 votes
Accepted

How can I to do this?, but with lines join

This looks very much like a Young tableau: \documentclass{article} \usepackage[table]{xcolor} \usepackage{booktabs} \usepackage{ytableau} \definecolor{myyellow}{rgb}{1,1,0} \definecolor{mybrown}{rgb}...
egreg's user avatar
  • 1.1m
5 votes
Accepted

Problem with highlighting a row in a table

The text only looks relatively high in the coloured panel as you have tall characters like C and d and the digits and no characters with descenders other than a small part of the () However you can ...
David Carlisle's user avatar
5 votes

\rowcolor and @{} issue

The package nicematrix with its environment {NiceTabular} tries to solve the problems of the package colortbl. Here is the output of {NiceTabular}. \documentclass{article} \usepackage{xcolor} \...
F. Pantigny's user avatar
  • 39.7k
5 votes

rowcolor too large when removing space on rows

You could use NiceTabular from the nicematrix package instead: \documentclass{article} \usepackage[table,xcdraw]{xcolor} \definecolor{mygray}{HTML}{BFBFBF} \usepackage{nicematrix} \begin{document} ...
leandriis's user avatar
  • 62.6k
5 votes

rowcolor too large when removing space on rows

I suggest setting \fboxsep to $0$ instead, and keeping the spaces at both ends of the table, loading cellspace for the vertical spacing at the top and bottom of the table: \documentclass{article} \...
Bernard's user avatar
  • 271k
5 votes
Accepted

How do I add vertical space of 10pt between the rows so that it is not as congested, while still maintaining the row colors?

One approach is to set \extrarowheight to 10pt (array package required). \documentclass{article} \usepackage{booktabs,array} \usepackage[table]{xcolor} \begin{document} \begin{table}[ht] \...
Steven B. Segletes's user avatar
5 votes
Accepted

\rowcolor makes the text disappear

Your table is unnecessary complicated. All multirows are unnecessary, multiline text can be complete in one cell and not each line in own rows. For example, first four rows in table body should be as ...
Zarko's user avatar
  • 296k
4 votes
Accepted

row color and a toggle

\rowcolors is (like \multicolumn) rather picky. It wants to be the first thing in a row. So you can't execute every code before it. With \togglefalse it doesn't matter as the \rowcolors is then not ...
Ulrike Fischer's user avatar
4 votes
Accepted

unset rowcolor in eqnarray

This seems to work; basically, we nullify the action of \@rowc@lors in the amsmath alignments. Of course, I do nothing to eqnarray that should never be used. \documentclass{article} \usepackage{...
egreg's user avatar
  • 1.1m
4 votes

Best way to add space between columns with alternating colored rows

I guess that you like to obtain something like this: To code is added makecell package for use of macro \thead{...} in column headings. Coloring of cells is moved to definition of new column type C, ...
Zarko's user avatar
  • 296k
4 votes
Accepted

How to prevent \rowcolor from overriding row lines in PGFPlotsTable?

Your problem isn't really caused by the row colour. The problem is that you do every head row/.style=.. twice. The stylename/.style syntax will override whatever previous definition that style had. ...
Torbjørn T.'s user avatar

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