# Specify table in tabularx environment

I have some really specific requirements for my table's occurrence in my master's thesis (scrbook). I found some help in this forum but there is not "the" solution for me. Below you can see my actual workaround for tables:

    \begin{table}[h]
\caption{xyz}
\label{xyz}
\centering\sffamily
\begin{tabularx}{1.0\textwidth}{|X|X|X|}
\hline
\rowcolor[gray]{0.8}
\multicolumn{1}{|c|}{\textbf{xyz}} & \multicolumn{1}{|c|}{\textbf{xyz}} & \multicolumn{1}{c|}{\textbf{xyz}} \\ \hline
\textbf{xyz} & xyz & xyz \\ \hline
\textbf{xyz} & xyz & xyz \\ \hline
\textbf{xyz} & xyz & xyz \\ \hline
\textbf{xyz} & xyz & xyz \\ \hline
\end{tabularx}
\end{table}


My institute’s requirements are listed below if they are not already implemented.

(1) The first row's height has to be 1cm, the text should be boldfaced plus horizontal AND vertical centered.

(2) Text in the first column should be vertical centered but horizontal left aligned (except of the first cell where formatting (1) applies).

(3) The remaining text should be horizontal left and vertical top aligned.

Further I have set my global line spread by using

    \renewcommand{\baselinestretch}{1.12}


Within my table I would like to have single spacing, but using the \setspace-command is not an option. Is it possible to realize all this? I already thought about preparing tables as pdfs and input them as graphics...

I hope i described my problem understandable ;) Else I will give it a second try!!

Cheers, Julian


Do you like to have something like this:

I didn't measure height of the first row (it should be approximately 1cm), for other rows I understand that they haven't request for minimal height of 1cm. In code I use thead from the makecell package. With renewcommad I select boldface fonts for them, boldface fonts in the first column is determined by option of the first column.

Vertical centering in the cells of the first column is achieved by \multirowcell, where you need to determine number of lines in the highest cell in the row.

Code:

\documentclass{article}
\usepackage[svgnames,table]{xcolor}
\usepackage{array,makecell,multirow,tabularx}
\renewcommand{\arraystretch}{1.2}% for global setting
% (amount select according to your taste)
\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{5pt}%

\begin{document}
\begin{table}[h]
%\renewcommand{\arraystretch}{1.2}% only for local use
\caption{xyz}
\label{xyz}
\centering\sffamily
\begin{tabularx}{\textwidth}{|>{\bfseries}X|X|X|}
\hline
\rowcolor[gray]{0.8}

• @Julian, just add \renewcommand{\arraystretch}{1.2 in preamble for global change of stretch or before table for lovcal table only. I will edit my answer with this. – Zarko Aug 14 '15 at 9:56