0

I just want to know how to insert a single character like $ in only one column of a table.

To be precise I don't want that character in my heading, but in all other data rows of the corresponding column. I tried it by using {\@$}, but it didn't help me much.

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. And the answer is \$ most probably – user31729 Jul 21 '14 at 18:06
1

Here is a way to go, with array and its modifier >{…} that allows to insert commands at the beginning of each cell of a column. It allows here to insert the $ sign in each cell of the second column, and the number of the rows in the first column.

I also use makecell to have easy common formatting of column heads, and variable width horizontal rules:

\documentclass[a4paper, 11pf]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[x11names]{xcolor} 

\usepackage{array}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\renewcommand\arraystretch{1.333}

\begin{document}

\begin{table}[!h]
\newcounter{tabenum}\setcounter{tabenum}{0}
\newcommand{\tabitem}{\addtocounter{tabenum}{1}\color{IndianRed3}\sffamily\footnotesize\thetabenum}
\begin{tabular}{>{\tabitem}l>{\color{DarkSeaGreen4}\sffamily\$}lccc}
\Xcline{2-5}{0.8pt}
\multicolumn{2}{c}{} & \thead{Head 1} & \thead{Head 2} & \thead{Head 3} \\
\cline{2-5}
  & & & & \\
  & & & & \\
  & & & & \\
  & & & & \\
\Xcline{2-5}{.8pt}
\end{tabular}%
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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