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.
283
questions
44
votes
4
answers
26k
views
Professional-looking tables with alternating row colors?
Both the Booktabs documentation and the Small Guide to Making Nice Tables provide some nice rules-of-thumb for making professional-looking tables (e.g., no double rules, no vertical rules, etc.)
Q: ...
40
votes
7
answers
37k
views
Matrix change row or column background
I have a matrix shown below. I would like to have the whole row green rather than only the cells.
How can I do that?
\begin{equation}\label{eq:appendrow}
\newcommand\x{\times}
\newcommand\y{\...
32
votes
4
answers
19k
views
Cellcolor overwrites partial horizontal lines (\cline)
So I need to make a colored table with multirows, together with the use of partial horizontal lines. I used \cline which does not work: the \cellcolor-command overwrites the line. This question told ...
25
votes
3
answers
22k
views
coloring entire row of tabular*
I would like to have the first row of all my tables colored with a certain color (below yellow) but somehow below thing is not working as expected
This:
\documentclass[a4paper, 12pt]{report}
\...
19
votes
2
answers
20k
views
Math inside tables and formatting
I'm trying to make a little summary of mathematic analysis, useful for my university, in LaTeX. I'm stuck in the problem of creating nice table, with alternate colouring containing equations with ...
19
votes
1
answer
1k
views
Strange disappearing colored rules in beamer
I have received a booktabs bug report of \cmidrules that disappear when coloured rules are used inside beamer (together with colortbl). The problem can be illustrated with the following simple code ...
17
votes
4
answers
13k
views
Highlight table cells using thick, colored border
I'd like to highlight certain cells of my table. In particular, I'd like to set the border of these sells colored and thick. These cells should also have a background color.
Here's a minimal example ...
17
votes
3
answers
5k
views
colortbl: \rowcolor in tables with \begin{tabular}{@{}ccc@{}}
I'm trying to make a table with the following code:
\begin{tabular}{@{}ccc@{}}
\hline
\rowcolor[gray]{.9} a & b & c \\
\hline
\end{tabular}
Unfortunately the \rowcolor command seems ...
15
votes
2
answers
6k
views
Table using booktabs and cellcolor looks ugly
When using \cellcolor in a booktabs table, I find that the output is not really appealing:
I don't really care that the colored cell does not touch the lines above and below (cf. Coloring columns in ...
15
votes
2
answers
2k
views
Very thin white line in colortbl
Whenever I use the colortbl package to format tables, a thin white space between the cells sometimes shows up on screen (not in print for as far as I can tell). For example in this table:
Is there an ...
13
votes
2
answers
8k
views
What is the name of the color used in CambridgeUS?
What is the name of the reddish color used in LaTeX beamer CambridgeUS theme?
I would like to use this color in my table using \cellcolor command in colortbl package.
13
votes
1
answer
135k
views
Define and use new colors for \rowcolor (Colortbl)
How can I use the maroon that I have defined, instead of the gray? Or (better) how can I use directly the maroon from:
\usepackage[dvipsnames]{xcolor}
\documentclass{scrbook}
\usepackage{colortbl}
...
13
votes
3
answers
3k
views
Booktabs and colortbl not filling height of row
I have a simple booktabs table very similar to the following MWE:
\documentclass[12pt]{article}
% set the font of the document
\usepackage{fontspec}
% set line spacing
\usepackage{setspace}
\...
13
votes
1
answer
8k
views
\hfill inside a tabular environment doesn't flush right
When I put an \hfill in a tabular row colored using the colortbl package, the coloring does not extend to what I would expect the end of the row to be.
For example, the code:
\documentclass{article}
...
12
votes
1
answer
19k
views
Use \cellcolor in \tabulary
The \cellcolor command from package colortbl doesn't seem to have any effect in a tabulary environment, though it works in tabular. Here is a minimal example:
\documentclass[a4paper]{article}
\...
12
votes
2
answers
3k
views
Alpha channel in colortbl
I'm using the colortbl package to color table cells. I've combined this w/ the xcolor package to define my own colors. However, it appears that xcolor does not support transparency. I saw the ...
12
votes
2
answers
2k
views
new array.sty and colortbl.sty incompatibility?
I just upgraded my texlive distribution and can no longer insert space in table rows using \\[x pt] syntax when colortbl is loaded.
It seems that recent changes to array.sty might be the problem as ...
12
votes
3
answers
19k
views
Colored tables and cline/hhline
How to write \clines (or \hhline) in colored tables so that the color of the cell does not hide the line?
Here are two solutions but neither of them works fine.
\documentclass[a4paper,11pt]{article} ...
11
votes
3
answers
607
views
Layout of complex table
The MWE
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{ragged2e}
\...
11
votes
3
answers
604
views
Approximate excel spreadsheet
I am trying to approximate the following table below.
After a lot of work I was able to produce the following table using the tabu package
In the MWE I included the showframe option, just to see ...
11
votes
1
answer
2k
views
Tabu very recently stopped working with color/xcolor or with fancyvrb
Below is a MWE with a tabu table that compiled perfectly fine up until I updated packages today (Dec. 16, 2018) with TeX Live Utility.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{...
10
votes
4
answers
1k
views
Table xcolor @{,} \rowcolor broken text
i am using a formatted table like this:
\documentclass[a4paper,10pt]{report}
\usepackage[table]{xcolor}
\begin{document}
\begin{tabular}{|c|r@{,}l|c|c|c|c|}
\hline
$B_N$ ...
10
votes
1
answer
942
views
LaTeX's datatool package together with siunitx
I want to use the datatool package to read csv files and parse them to LaTeX tables. Furthermore I want to use siunitx to format the numbers from the csv file.
Have a look at the following example:
\...
9
votes
1
answer
518
views
xcolor and everycr-Problem
I'm trying to insert some \noalign-code in every row of a tabular by using colortbl and \everycr or \CT@everycr. In most cases it works fine, but not if there is a \rowcolors-command (from xcolor) ...
9
votes
2
answers
3k
views
White space between columns using \rowcolor{somecolor}
I have been using \rowcolor{color} command and I have noticed that there is always some white space between one cell and the next one in the row.
Here is my code:
\documentclass[11pt,letterpaper]{...
8
votes
2
answers
3k
views
Interaction between \hdotsfor and colortbl: Bug/Feature?
When using package colortbl, the command \hdotsfor fails (partially), leaving too much white space before and after the dotted part. The mwe
\documentclass{book}
\usepackage{colortbl}
\usepackage{...
8
votes
3
answers
289
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[...
8
votes
3
answers
989
views
colortbl rowcolor overtop of @{decl}
I have tables with many $\pm$ values that I was using the @{decl} command to have nice alignment. However, I wanted to add some row colors. Trying to use colortbl I found that the cell/row color was ...
8
votes
2
answers
966
views
Hiding a column with colored cells
I want to use the column type described in this answer to hide certain columns in a table. The table occurs multiple times throughout the document, always with different columns hidden. Some of the ...
8
votes
2
answers
2k
views
How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule?
I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table. However, when \arrayrulecolor is used with \cmidrule, some odd ...
8
votes
1
answer
31k
views
Specify starting row number for \rowcolors from colortbl package
In the following application of \rowcolors from the colortbl package, how can I specify the option to start the alternating color pattern from the 3rd row onwards? The first two rows in this case are ...
8
votes
2
answers
758
views
Why does \rowcolors cut matrix delimiter?
I want to typeset a tabular with alterning row colors, containing matrices. Somehow, when adding \rowcolors{1}{}{black!5} the left bracket of some matrices is just omited. What am I doing wrong and ...
8
votes
3
answers
2k
views
Table Row Color Covers Text
I am trying to create a table with alternating row colors using the xcolor package with the [table] option.
The following example demonstrates that the row coloring (uncommenting the \rowcolors..) ...
8
votes
1
answer
10k
views
Displaying the horizontal and vertical lines of a table after coloring rows
How can I re-show each line in the following table after coloring the row?
\documentclass[english,a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[latin9]{inputenc}
\...
7
votes
2
answers
587
views
Making a table with special headings
What package can I use to make a table that looks like this one?
7
votes
2
answers
2k
views
Does something like \rowcolors exist for groups of rows?
I need to find a package or else learn how to make a tex command definition that does something very similar to the \rowcolors command for tables, for creating a table with alternating background ...
7
votes
1
answer
536
views
Use siunitx to round numbers while using colortbl to color cells
I typically use the siunitx package to round numbers in tables and use the \cellcolor command of the colortbl package to change the background colors of certain cells. However, as the following ...
7
votes
1
answer
530
views
Wrong color with hsb color series in xelatex
I tried to use hsb color series provided by xcolor package in the following code:
\documentclass{standalone}
\usepackage[table]{xcolor}
\begin{document}
% example one
\definecolorseries{test}{hsb}{...
7
votes
1
answer
242
views
delarray and colortbl issue
There seems to have a compatibility issue between the colortbl and delarray packages because when compiling the following code :
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{...
7
votes
3
answers
3k
views
Eliminating little white vertical lines in tabular* caused by colortbl/colorcell
In a larger project, we have trouble producing tables that look "just right" because use of colorcell leaves little vertical lines between colored cell areas. I've made a minimal table that ...
7
votes
3
answers
5k
views
how to prevent cell color to cover table's borders? [closed]
When I change the background color of a cell in a table, the color covers the borders, however I want the horizontal lines to remain.
I have a simple command \cellcolor[gray]{0.9} in my table. Can ...
6
votes
2
answers
3k
views
color a column red in a table
When I try to color a column red, it seems that white lines begin to emerge. Additionally the \hline changes width depending on how you zoom into the document in pdf format. It look as if the color ...
6
votes
1
answer
657
views
Listing with two columns in a single fancy frame
I am playing a little with lstlistings and I wonder whether such a thing would be achievable for all my listings:
How to achieve this kind of things?
Note : I am searching for a solution I can apply ...
6
votes
2
answers
1k
views
Space between \hline\hline in longtable using package colortbl
When I use a \usepackage{colortbl} a space between \hline\hline in \longtable dissapears. I haven't find any solution how to put the space back, so I hope you'll help me to find it.
\begin{longtable}{...
6
votes
2
answers
4k
views
How to set text color and font type of header row for all tables in LaTeX?
I have a document with plenty of tables and I would like to apply the same formatting of the header row for all of them, without making manual modifications for each tabular.
I now use \...
6
votes
2
answers
518
views
Strange behaviour of "underneath" accents and \rowcolor
The following example shows the problem using the \b command for the "bar-under" accent: it seems to interact in an unexpected way with \rowcolor. Uncommenting the appropriate \renewcommand line, the ...
6
votes
2
answers
8k
views
Colored diagonal divided table cell
How can I fill a table cell with different colors? I have tried the diagbox package but it doesn't work as you can see. I am not so much interested in the diagonal line. I only want to separate the ...
6
votes
2
answers
820
views
colortbl and amsmath conflict
I have a problem with colortbl and amsmath. Is someone here aware of a conflict between these two packages?
\documentclass[10pt]{article}
\usepackage{amsmath}
%\usepackage{colortbl}
\begin{document}
...
6
votes
3
answers
442
views
Specifying a starting column with colortbl package and xcolor
I have a table that I have attempted to set up as follows (contrived example):
% Preview source code
%% LyX 2.3.2-2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless ...
6
votes
1
answer
168
views
Table style customization
How to remove the extra color on the left and right of the rows?
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\usepackage{float}
\usepackage{tabu}
\...