\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{arydshln}
\usepackage[table]{xcolor}
\usepackage{pifont}
\begin{document}
\begin{center} \renewcommand*\arraystretch{1.2}
\scalebox{1}[1]{|c|{\begin{tabular}[t]{|rrl||c|c|c|c||c|} \hline\multicolumn{3}|} & {\sc{c1}} & {\sc{c2}} & {\sc{c3}} & {\sc{c4}} & {\textit{H}} \\[0.5ex]
\& & & {\textit{w=7}} & {\textit{w=3}} & {\textit{w=3}} & {\textit{w=1}} & \\
\hline \hline a. & \ding{43} & {O1} & & -3 & & -1 & -4 \\
\hline b. & & {O2} & & -3 & -3 & -1 & -7 \\
\hline c. & \ding{43} & {O3} & & & -3 & -1 & -4 \\
\hline \end{tabular} \renewcommand*\arraystretch{1} \end{center}
\end{document}
- 10,278
- 33
2 Answers
I suggest to simplify your syntax quite a bit:
instead of the
centerenvironment, which adds additional vertical spaces, you could use\centeringthe
\scalebox{1}{1}{...}does not have any effect (scales both directions by 1), thus can be left outyour second row has not enough entries, I suspect one empty cell is missing at the start
two-letter font commands are deprecated, see Does it matter if I use \textit or \it, \bfseries or \bf, etc (and just my personal opinion, the combination between small caps and numbers looks odd...)
for better spacing put your equations
w=3in math mode instead of italics, same for all the negative numbers. This will give you real minus signs instead of hyphensmany of the
{}around the cells are unnecessary (thank to @Au101 for pointing this out in the comments)and what Werner and Simon say in their comments below your question
and please have a look at http://betterposters.blogspot.com/2012/08/the-data-prison.html
\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{arydshln}
\usepackage[table]{xcolor}
\usepackage{pifont}
\begin{document}
\begingroup
\centering
\renewcommand*\arraystretch{1.2}
\begin{tabular}[t]{|rrl||c|c|c|c||c|}
\hline
\multicolumn{3}{|l}{} & \textsc{c1} & \textsc{c2} & \textsc{c3} & \textsc{c4} & \textit{H} \\[0.5ex]
\& & & & $w=7$ & $w=3$ & $w=3$ & $w=1$ &\\
\hline \hline
a. & \ding{43} & O1 & & $-3$ & & $-1$ & $-4$ \\
\hline
b. & & O2 & & $-3$ & $-3$ & $-1$ & $-7$ \\
\hline
c. & \ding{43} & O3 & & & $-3$ & $-1$ & $-4$ \\
\hline
\end{tabular}
\endgroup
\end{document}
- 158,329
-
Having corrected
{\sc{c1}}to{\textsc{c1}}surely you don't need the braces wrapped around\textsc{c1}? Although, actually they wouldn't have had any effect in the first place i don't believe – Au101 Jan 18 '19 at 22:46 -
@Au101 At least these braces don't hurt. They could be useful if one decides to automatically align the cells with siunitx (for this table probably overkill ...) – samcarter_is_at_topanswers.xyz Jan 18 '19 at 22:50
-
So just to add a stupid question to a stupid question -- how do I get the left hand double vertical bar to go all the way to the top? – Simon Rake Jan 18 '19 at 22:57
-
-
@SimonRake Remove
\multicolumn{3}{|l}{}and instead write& &to get the double bar until the top – samcarter_is_at_topanswers.xyz Jan 18 '19 at 23:04
Maybe this is what you want?
\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{amsmath, amssymb}
\usepackage{hhline}
\usepackage{arydshln}
\usepackage[table]{xcolor}
\usepackage{pifont}
\begin{document}
\[ \renewcommand*\arraystretch{1.2}
\begin{array}
{|rrl||c|c|c|c||c|}
\hhline{---||----||-}
\textsc{c1} & & & {\textsc{c2}} & {\textsc{c3}} & {\textsc{c4}} & {H} & \\[0.5ex]
\text{\&} & & {w=7} & {w=3} & {w=3} & {w=1} & & \\
\hhline{===::====::=}
a. & \text{\ding{43}} & {O1} & & -3 & & -1 & -4 \\
\hhline{---||----||-} b. & & {O2} & & -3 & -3 & -1 & -7 \\
\hhline{---||----||-}
c. & \text{\ding{43}} & {O3} & & & -3 & -1 & -4 \\
\hhline{---||----||-}
\end{array}\]%
\end{document}
- 271,350


\scalebox{.}[.]{...construction. Also, the initial|c|contained in the\scaleboxargument seems out-of-place. – Werner Jan 18 '19 at 22:24{\begin{tabular}[t]{|rrl||c|c|c|c||c|} \hline\multicolumn{3}|}in braces. – Simon Jan 18 '19 at 22:30