We have a latex tabu
table with custom header's style: it has different alignment, color and shape from other table rows.
BTW XeLaTeX
is used.
Header could be short on length, see the pictures and minimal working example (MWE, in the end).
It is neccesarry to apply following style to header text:
- bold;
- aligned to horizontal center;
- aligned to vertical center (both for one line or word wrapped cases);
- custom color is
#0070C0
;
Desired result
We have applied \rowfont{}
command to the first tabu
table row as in answer https://tex.stackexchange.com/a/26363/123948
\taburulecolor{DarkBlue}
\tabulinesep = 1mm
\begin{tabu} to 170 mm {
|X[2] % |X[2,m]
|X[1.5] % |X[1.5,m]
|X[0.6, C] % |X[0.6, C,m]
|X[2] % |X[2,m]
|X[0.6, C]| % |X[0.6, C,m]|
}
\rowfont{\centering\bfseries\color{Blue}}
%...
and:
- text became bold using
\bfseries
; - aligned to horizontal center using
\centering
; - color is
\definecolor{Blue}{HTML}{1C8CCC}
; - tried
tabu
'sm
colunm type to align to vertical center, but it works only in wrapped case (one-line is not) and it affects to whole table, but we need header only.
Actual result
without m
type because it affects to the whole table
Questions
- How to align vertically only header text using
\rowfont{}
(or other way)? - Are horizontal alignment and coloring of header row implemented correctly or there are better ways?
Minimal working example
XeLaTeX is used.
\documentclass[10pt, oneside, a4paper]{report}
\usepackage[left=2cm,right=1.5cm,
top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{tabu}
\usepackage[svgnames]{xcolor}
\definecolor{DarkBlue}{HTML}{0070C0}
\definecolor{Blue}{HTML}{1C8CCC}
\usepackage{multirow}
\usepackage{polyglossia}
\setmainfont[Ligatures=TeX]{Arial}
%--------------------------------------------
\begin{document}
\taburulecolor{DarkBlue}
\tabulinesep = 1mm
\begin{tabu} to 170 mm {
|X[2] % |X[2,m]
|X[1.5] % |X[1.5,m]
|X[0.6, C] % |X[0.6, C,m]
|X[2] % |X[2,m]
|X[0.6, C]| % |X[0.6, C,m]|
}
\rowfont{\centering\bfseries\color{Blue}}
\hline
Status
& Visual indication: color and indication type %% WORD WRAP
% & Visual indication %% one line
& Symbol
& Audible signal
& Priority\\ \hline
Alarm active, not acknowledge
& Red, blinking
& picture
& Accompanied by an audible signal, as 3 short audible signals repeated every 7 s
& High
\\ \hline
Alarm active, silenced
& Red, blinking
& picture
& Silent
&
\\ \hline
\end{tabu}
\end{document}
tabu
is nice package, unfortunately it is buggy and no more maintained.tabu
is not actual now, which if existing table packaged is powerful enough to substitute tabu?