Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am a new user (both to LaTeX & this forum).

I want to create a Comparison Table for an Article (like the one shown here):

enter image description here

Can someone please help me with this.

share|improve this question
1  
Welcome! I think for such tables you need tikz or pstricks. Examples for tikz / pgfplosttable can be found here: tex.stackexchange.com/questions/28087/… –  Marco Daniel Aug 17 '12 at 15:26
    
@billjoy It would be useful to know which part of the table you are struggling with. Marco has already linked to a question about appearance: is that what you are after? –  Joseph Wright Aug 17 '12 at 15:48
    
@Joseph: Yes, I am trying to prepare a table with a similar appearance as in the link provided by Macro. Thanks. –  bill joy Aug 17 '12 at 15:56
1  
I thought that making at least a perfectly rectangular table as above might be trivial with TiKZ, but it turns out to be annoyingly difficult to find a simple means of controlling the color of the first column while specifying the colors of the even/odd rows. I would appreciate a sketch of how one might make such tables as an illustrative exercise. –  Niel de Beaudrap Aug 17 '12 at 16:17
2  
Yes, it would be great if we could have a live example for this problem. –  Sandeep Singh Aug 17 '12 at 16:33

3 Answers 3

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}

enter image description here

share|improve this answer
    
Ah, nice! this is much better than mine. This time I must delete my answer ;-) –  Gonzalo Medina Aug 18 '12 at 21:22
    
@GonzaloMedina Today we are really on a roll :) –  percusse Aug 18 '12 at 21:22
    
Ohhhhh so close! Can you easily make the first column (inlcuding the first row) entirely grey? –  Niel de Beaudrap Aug 19 '12 at 1:30
    
@NieldeBeaudrap I've deliberately left it out since I think row is better to group but see the edit. –  percusse Aug 19 '12 at 7:37
    
Having now taken time to look at the solution, it's good to know that every even row can be put in a column specification. I see that we get around the non-uniformity of the first column by setting the row styles in the remaining columns; it's a good thing that there aren't many columns. –  Niel de Beaudrap Aug 19 '12 at 11:20

If you can live without the rounded corners, you can do something like this.

\documentclass{article}
\usepackage{xcolor}
\usepackage{tabu}
\usepackage{colortbl}

\begin{document}

\taburowcolors[2]{white .. black!20}

\sffamily\footnotesize
\tabulinesep=6pt
\begin{tabu}{|>{\cellcolor{black!60}\color{white}}r|X[cm]|X[cm]|}
\hline
\rowcolor{black!80}\strut  & \color{white}Enterprise SAN & \color{white}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\\
\hline
\end{tabu}

\end{document}

enter image description here

Rounded corners will probably need some TikZ magic, I'll see if I can come up with something.

share|improve this answer
    
I suspect you could do something with transparencies in PGF, to make a rectangle with an ovoid cutaway. –  Niel de Beaudrap Aug 18 '12 at 18:59
    
@tohecz Right, I tried putting \color{white} in \everyrow but that caused a strange error. Cleaned up the code. –  mrf Aug 18 '12 at 20:05

tcolorbox includes a tabularx option which can be used to obtain rounded corners framed tabulars.

\documentclass[tikz,table,border=2mm]{standalone}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\usepackage{array,tabularx}
\usepackage[most]{tcolorbox}

\begin{document}

\rowcolors{1}{black!30}{white}
\begin{tcolorbox}[enhanced, notitle, clip upper, fontupper=\sffamily,%
    tabularx={>{\cellcolor[gray]{.5}\color{white}}r%
              >{\centering\arraybackslash}X%
              >{\centering\arraybackslash}X}]
  &\cellcolor{black!80}\color{white}Enterprise SAN &\cellcolor{black!80}\color{white}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{tcolorbox}
\end{document}

enter image description here

share|improve this answer
    
Above code I convert in 4 rows x 4 columns but it is not working. –  SKKhan Jun 18 at 13:43
2  
@LaTeXKhan: Instead of asking in a comment it's better to do a new question with reference to this one. In any case unless you give us more information nobody could help. It's like: I've a problem, can you solve it? –  Ignasi Jun 18 at 14:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.