1

I make this Table MS Word. But I am interest to make this Table in LaTeXenter image description here

% Table generated by Excel2LaTeX from sheet 'Sheet2'
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{rcrrr}
%\toprule
\multirow{2}[2]{*}{} & \textbf{} & \multicolumn{1}{c}{\textbf{Development}} &    \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} \\
%\midrule
      & \textbf{License} & \multicolumn{1}{c}{\textbf{Language}} & \multicolumn{1}{c}{\textbf{Platforms}} & \multicolumn{1}{c}{\textbf{Support}} \\
\multicolumn{1}{c}{\textbf{}} & \textbf{} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\multirow{2}[1]{*}{\textbf{Linux/Unix, Windows, MAC OSX}}} & \multicolumn{1}{c}{} \\
\multicolumn{1}{c}{\textbf{Julius}} & \textbf{BSD} & \multicolumn{1}{c}{\textbf{C}} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{\textbf{_}} \\
\multicolumn{1}{c}{\textbf{}} & \multirow{3}[0]{*}{\textbf{Prohibits redistributions and commercial use but R \& D allowed}} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} \\
\multicolumn{1}{c}{\textbf{}} &       & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{Windows, Linux/Unix, MAC OSX}} & \multicolumn{1}{c}{\textbf{HTK Book, Active Mailing List}} \\
\multicolumn{1}{c}{\textbf{HTK}} &       & \multicolumn{1}{c}{\textbf{C}} &       &  \\
\multicolumn{1}{c}{\textbf{}} & \textbf{} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} \\
\multicolumn{1}{c}{\textbf{}} & \textbf{} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{Linux/Unix, Windows, MAC OSX}} & \multicolumn{1}{c}{\textbf{Very well documented}} \\
\multicolumn{1}{c}{\textbf{Sphinx}} & \textbf{BSD} & \multicolumn{1}{c}{\textbf{C, JAVA}} &       &  \\
      & \textbf{} &       &       &  \\
      & \textbf{} &       &       &  \\
      & \textbf{} &       &       &  \\
\multicolumn{1}{c}{\textbf{}} & \textbf{} & \multicolumn{1}{c}{\textbf{}} &     \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{}} \\
\multicolumn{1}{c}{\textbf{ISIP ASR}} & \textbf{Public domain (no restrictions)} &    \multicolumn{1}{c}{\textbf{C++}} & \multicolumn{1}{c}{\textbf{Windows}} & \multicolumn{1}{c}{\textbf{_}} \\
%\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%

I generate this code through Excel2LaTeX. But this is not working.

Micky K
  • 1,457
  • Maybe, http://tex.stackexchange.com/questions/176220/fancy-colored-array-in-latex/176228#176228 is helpful. – Thomas F. Sturm Jun 18 '14 at 11:08
  • I am trying to convert it in 4 x 4 but it is not workig anyoe help me. http://tex.stackexchange.com/questions/67586/how-to-create-comparison-tables-in-latex – Micky K Jun 18 '14 at 13:45

2 Answers2

3

This is not an answer to the question but an answer that shows how to draw such a table in ConTeXt.

I find ConTeXt to be much better suited for such tables than LaTeX. ConTeXt allows for a nice separation of content and presentation. For example, the basic structure to achieve the requested layout is:

\startsetups table:style
  % Fill in the details
\stopsetups

\starttext
\startTABLE[setups=table:style]
  \NC           \NC License \NC Development Language \NC Platforms                    \NC Support                       \NC \NR
  \NC Julius    \NC BSD     \NC C                    \NC Linux/Unix, Windows, Mac OSX \NC ---                           \NC \NR
  \NC HTK       \NC Prohibits redistribution and commercial use, but R&D allowed
                            \NC C                    \NC Linux/Unix, Windows, Mac OSX \NC HTK Book, Active mailing list \NC \NR
  \NC Sphinx    \NC BSD     \NC C, Java              \NC Linux/Unix, Windows, Mac OSX \NC Very well documented          \NC \NR
  \NC ISIP ASR  \NC Public Domain (no restrictions)
                            \NC C++                  \NC Windows                      \NC ---                           \NC \NR
\stopTABLE

\stoptext

Without any modifications of table:style, the default output is:

enter image description here

To get the desired output, start by setting the font style (bold) and alignment (horizontally and vertically middle aligned), and add some offset around the cells. This can be done by:

\startsetups table:style
  \setupTABLE[align={middle,lohi}, foregroundstyle=bold, offset=0.25ex]
\stopsetups

which gives

enter image description here

Finally, set the background color for cells using:

  \setupTABLE[background=color, framecolor=white]
  \setupTABLE[row][odd] [backgroundcolor=rowcolor1]
  \setupTABLE[row][even][backgroundcolor=rowcolor2]

  \setupTABLE[row][first][backgroundcolor=headercolor,foregroundcolor=white]
  \setupTABLE[column][first][backgroundcolor=headercolor,foregroundcolor=white]

which gives:

enter image description here

The complete code is

\definecolor[rowcolor1]  [h=E6EED6]
\definecolor[rowcolor2]  [h=CDDDAC]
\definecolor[headercolor][h=9BBB58]

\startsetups table:style
  \setupTABLE[align={middle,lohi}, foregroundstyle=bold, offset=0.5em]

  \setupTABLE[background=color, framecolor=white]
  \setupTABLE[row][odd] [backgroundcolor=rowcolor1]
  \setupTABLE[row][even][backgroundcolor=rowcolor2]

  \setupTABLE[row][first][backgroundcolor=headercolor,foregroundcolor=white]
  \setupTABLE[column][first][backgroundcolor=headercolor,foregroundcolor=white]
\stopsetups

\starttext
\startTABLE[setups=table:style]
  \NC           \NC License \NC Development Language \NC Platforms                    \NC Support                       \NC \NR
  \NC Julius    \NC BSD     \NC C                    \NC Linux/Unix, Windows, Mac OSX \NC ---                           \NC \NR
  \NC HTK       \NC Prohibits redistribution and commercial use, but R&D allowed
                            \NC C                    \NC Linux/Unix, Windows, Mac OSX \NC HTK Book, Active mailing list \NC \NR
  \NC Sphinx    \NC BSD     \NC C, Java              \NC Linux/Unix, Windows, Mac OSX \NC Very well documented          \NC \NR
  \NC ISIP ASR  \NC Public Domain (no restrictions)
                            \NC C++                  \NC Windows                      \NC ---                           \NC \NR
\stopTABLE

\stoptext
Aditya
  • 62,301
  • 1
    +1 This is clearly nice. I hope some day this comes to the LaTeX world (or may be I end up in ConTeXt). – Manuel Jun 17 '14 at 20:48
  • @Aditya I am working in LaTeX. Please share the full code with LaTeX packages. Also I find the link which I am sharing here http://tex.stackexchange.com/questions/67586/how-to-create-comparison-tables-in-latex – Micky K Jun 18 '14 at 00:33
  • 1
    @LaTeXKhan, as I said, this is a context solution, not a latex one. This is the full code. – Aditya Jun 18 '14 at 02:41
2

I you think can use several commands to specify the cell background color, row color or even column color, you can set the color on RGB or HTML. Here's an example:

\documentclass{article}
\usepackage[table,xcdraw]{xcolor}

\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{rcrrr}
\rowcolor[HTML]{32CB00} % Fill color of the entire row
something & something & something & something & something \\
\rowcolor[HTML]{67FD9A} 
\cellcolor[HTML]{32CB00} something & something  & something & something & something \\
\rowcolor[HTML]{9AFF99} 
\cellcolor[HTML]{32CB00} something & something & something & something & something \\
\rowcolor[HTML]{67FD9A} 
\cellcolor[HTML]{32CB00}something & something & something & something & something
\end{tabular}
\end{table}

\end{document}

Make sure you have xcolor on your preamble with the options "table" and "xcdraw" . The \rowcolor[]{} command fills up the whole row, while the \cellcolor[]{} colors only the cell where you put it.

Tepexic
  • 21
  • 4