Can I change the column heading to be left-justified but leave the values contents of the data part of the column right-aligned?
Yes. Just place the cell's contents in a \multicolumn{1}{l}{...}
"wrapper".
Incidentally, instead of using the somewhat kludgy \hline\noalign{\smallskip}
directives, I suggest you load the booktabs
package and use its macros \toprule
, \midrule
, and \botttomrule
to get well-spaced horizontal lines.
And, instead of the >{\hfill}p{3.50cm}
specification of the left-most column, I suggest you load the array
and ragged2e
packages and define a raggedleft (flushright) column type that takes a width parameter, as is done in the example below.
\documentclass{article}
\usepackage[margin=1in,a4paper]{geometry} % choose margins appropriately
\usepackage{array,booktabs,ragged2e}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{ R{3.50cm} p{5.50cm} p{5.50cm} }
\toprule
\multicolumn{1}{l}{\textbf{Column 1}} & \textbf{Column 2} & \textbf{Column 3} \\
\midrule
1 & text & text \\
2 & text & text \\
\bottomrule
\end{tabular}
\caption{thisTable.}
\label{tab:thisTable}
\end{table}
\end{document}
Addendum to address the OP's follow-up question: If the cell in question has a lot of text that needs to span several lines, you can still use \multicolumn
, but not with the l
column type specifier. E.g., you might type
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash}p{#1}}
in the preamble and then write
\multicolumn{1}{L{3.50cm}}{An incredibly long header that occupies several lines.}
instead of the earlier
\multicolumn{1}{l}{\textbf{Column 1}}
In short, \multicolumn
is a very powerful and flexible tool.
I would use a list here. I used itemize
of course if your first column really is a counter in your real document it can be simplified more and use enumerate
I used multicolumn
not multicolumn*
as there was not enough text to fill 4 unbalanced columns in this example.
\documentclass[12pt,twoside]{scrbook}
% no \usepackage{ucs}
% no \usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multicol}
%\usepackage{xtab}
\begin{document}
\begin{multicols}{4} %Beginning of the four-column environment
\begin{itemize}
\item[1] Montag
\item[2] Dienstag
\item[3] Mittwoch
\item[4] Donnerstag
\item[5] Freitag
\item[6] Samstag
\item[7] Sonntag
\item[8] Montag
\item[9] Dienstag
\item[10] Mittwoch
\item[11] Donnerstag
\item[12] Freitag
\item[13] Samstag
\item[14] Sonntag
\item[15] Montag
\item[16] Dienstag
\item[17] Mittwoch
\item[18] Donnerstag
\item[19] Freitag
\item[20] Samstag
\item[21] Sonntag
\item[22] Montag
\item[23] Dienstag
\item[24] Mittwoch
\item[25] Donnerstag
\item[26] Freitag
\item[27] Samstag
\item[28] Sonntag
\item[29] Montag
\item[30] Dienstag
\item[31] Mittwoch
\item[32] Donnerstag
\item[33] Freitag
\item[34] Samstag
\item[35] Sonntag
\item[36] Montag
\item[37] Dienstag
\item[38] Mittwoch
\item[39] Donnerstag
\item[40] Freitag
\item[41] Samstag
\item[42] Sonntag
\item[43] Montag
\item[44] Dienstag
\item[45] Mittwoch
\item[46] Donnerstag
\item[47] Freitag
\item[48] Samstag
\item[49] Sonntag
\item[50] Montag
\item[51] Dienstag
\item[52] Mittwoch
\end{itemize}
\end{multicols}
\end{document}
Best Answer
Despite of this question has been answered in comments and questions like this have been discused before in this community many times, I am amswering it just in order to improve a little bit the code and to show a couple of things regarding tables:
table
environment to make it float, like infigure
environment, so it also can have its own caption. (See Tables in LaTeX2ε: Packages and Methods).\usepackage{booktabs}
loadsarray
and it is a ver powerful package for tables. It also permits the usage of rules in other array-like environments (ibidem, page 9.).!htpb
between brackets, specify placement in float objects like tables. (See this answer).{cccccccccccc}
, one can write a brief and simple notation*{12}{c}
. (See this answer)Improved visualization of table
The code