2

I want to achieve a table with: 1. a global tabulinesep 2. the left column in bold 3. The top row bold, white and a red panel However when I add rowfont the tabulinesep breaks down. How do I do this?

Preamble

\usepackage{colortbl} 
\usepackage{tabu} 
\global\tabulinesep=3mm %Minimal vertical space in tables

Main

\begin{table}[H]
    \begin{tabu}[X]{|>{\bfseries}X[4]|X[2c]|X[4]|}
    \everyrow{\hline}
    \rowcolor{red}
    \rowfont{\color{white}\bfseries}
    text & text & text \\
    text & text & text \\
    text & text & text \\
    text & text & text \\
    \end{tabu}
\end{table}
1
  • Can you draw a simple paint example what the result shall be? So it's more easy to understand. And please insert 4 spaces before end table. I can't to that, because minimum change is 6 characters. May 27, 2016 at 9:29

1 Answer 1

1

The new LaTeX3 package tabularray is an alternative to the outdated tabu package:

\documentclass{article}

\usepackage{float}
\usepackage{xcolor} 
\usepackage{tabularray} 
\SetTblrInner{rowsep=1mm}

\begin{document}

\begin{table}[H]
  \begin{tblr}{
    colspec = {|X[4]|X[2,c]|X[4]|},
    row{1} = {bg=red3, fg=white, font=\bfseries},
    column{1} = {font=\bfseries},
    hlines,
  }
    text & text & text \\
    text & text & text \\
    text & text & text \\
    text & text & text \\
  \end{tblr}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .