I swear somebody said TikZ!
\documentclass{standalone}
\usepackage{tikz}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\clip node (m) [matrix,matrix of nodes,
fill=black!20,inner sep=0pt,
nodes in empty cells,
nodes={minimum height=1cm,minimum width=2.6cm,anchor=center,outer sep=0,font=\sffamily},
row 1/.style={nodes={fill=black,text=white}},
column 1/.style={nodes={fill=gray,text=white,align=right,text width=2.5cm,text depth=0.5ex}},
column 2/.style={text width=4cm,align=center,every even row/.style={nodes={fill=white}}},
column 3/.style={text width=3cm,align=center,every even row/.style={nodes={fill=white}},},
row 1 column 1/.style={nodes={fill=gray}},
prefix after command={[rounded corners=4mm] (m.north east) rectangle (m.south west)}
] {
& Enterprise SAN & ioDrive \\
Form Factor & Rack Applicance (40U $\times$ 20") & Low Profile PCIe \\
Interface & FC-4 & PCIe x4 \\
Drive Units & 150$\times$15 RPM disks & 2$\times$80gig\\
Data Protection & Mirroring & Mirroring\\
Power & 33.372 kWh/yr & 114 kWh/yr\\
SPC-1 I0PS & 24.998 & 86.127\\
};
\end{tikzpicture}
\end{document}
You cannot embed (or contain) a float inside a box (\parbox
or minipage
, say). Moreover, you don't need the table
(float) environment in order to set a tabular
. So you could just get by with the following:
\documentclass{article}
\usepackage{xcolor,tabularx}% http://ctan.org/pkg/{xcolor,tabularx}
\begin{document}
text $i=j$
\noindent
\fcolorbox{black}{black!20}{\parbox{\dimexpr\textwidth-2\fboxsep-2\fboxrule}{%
\color{red!50!black}%
again text and $math$
\begin{tabular}{ccc}
\textbf{Q} & \textbf{test}&\textbf{test2}\\
\hline
5 &&\\
\hline
\end{tabular}%
}}
\end{document}
Note that using a \parbox
of width \textwidth
inside a \fcolorbox
will cause an overfull \hbox
. That is because the \fcolorbox
adds some separation (\fboxsep
on both sides) and a rule (of width \fboxrule
, on both sides). I've accommodated for this using
\dimexpr\textwidth-2\fboxsep-2\fboxrule
as the width of the \parbox
.
Best Answer
Here's one possibility nesting
tabular
s:And suppressing the vertical rules and using
booktabs
: