You could use an option for customizing the origin of the rotation, such as \rotatebox[origin=c]{90}{...}
The manually added vertical space at the end of the rows destroys the aligment. see how it looks without:
\documentclass[11pt, a4paper]{article}
\usepackage{lmodern}
\usepackage{array}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{tabularx}
\begin{document}
\scriptsize
\setlength{\extrarowheight}{0.2em}
\noindent\begin{tabularx}{\textwidth}{!{\vrule width 1pt}
p{0.3cm} !{\vrule width 1pt} p{0.5cm} | p{4cm} | X !{\vrule
width 1pt}}
\noalign{\hrule height 1pt}
\multirow{4}{*}{\rotatebox[origin=c]{90}{Ten}}&
\multirow{2}{*}{\rotatebox[origin=c]{90}{Eight}}
& One & Two\\\cline{3-4}
& & Three & Four\\\cline{2-4}
&\multirow{2}{*}{\rotatebox[origin=c]{90}{Nine}}
& Five & Six\\ \cline{3-4}
& & \multicolumn{2}{ l !{\vrule width 1pt}}{Seven}\\
\noalign{\hrule height 1pt}
\end{tabularx}
\end{document}
If you make such manual adjustments, which multirow
doesn't know about, you can use the optional fixup
argument of \multirow
for correction:
\multirow{nrows}[bigstruts]{width}[fixup]{text}
For automatic rotating, I would use >{...}
and >{...}
of the array
package together with a sideways
environment of the rotating
package, such as
>{\begin{sideways}}p{0.3cm}<{\end{sideways}}
or even define a new column type for it:
\newcolumntype{R}[1]{>{\begin{sideways}}p{#1}<{\end{sideways}}}
Here's the example showing automatic rotation, but without multirow, since this would not work as intended as it's applied after rotation:
\documentclass[11pt, a4paper]{article}
\usepackage{lmodern}
\usepackage{array}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{rotating}
\newcolumntype{R}[1]{>{\begin{sideways}}p{#1}<{\end{sideways}}}
\begin{document}
\scriptsize
\setlength{\extrarowheight}{0.2em}
\noindent\begin{tabularx}{\textwidth}{!{\vrule width 1pt}
R{0.3cm} !{\vrule width 1pt} R{0.5cm} | p{4cm} | X !{\vrule
width 1pt}}
\noalign{\hrule height 1pt}
Ten & Eight
& One & Two\\\cline{3-4}
& & Three & Four\\\cline{2-4}
& Nine
& Five & Six\\ \cline{3-4}
& & \multicolumn{2}{ l !{\vrule width 1pt}}{Seven}\\
\noalign{\hrule height 1pt}
\end{tabularx}
\end{document}
Don't engage in so much visual formatting. Instead, define some pertinent table parameters -- such as centering the column contents, the heights of the rows, etc -- beforehand, and then create a lean and reasonably easy to read table.
In the example below, I've created a dummy definition of your \VTGN
macro to make the code compilable. You'll notice a complete absence of \vspace{3mm}
and \cl
directives in the code. Observe the use of \bigstrut
to size the heights of the rows: it's an object with a depth of 4ex
below the text baseline and a height of 6ex
above the baseline. (The strut's total height is thus 10pt
.) Adjust these parameters as needed to get the desired spacing. The strut's width is 0pt
; hence it's not visible. One \bigstrut
per row suffices.
\documentclass{article}
\usepackage[paperheight=28cm, paperwidth=20cm, margin=2cm]{geometry}
\newcommand\VTGN[1]{#1} %% just so that this example compiles
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcommand\bigstrut{\rule[-4ex]{0pt}{10ex}}
\begin{document}
\noindent
\begingroup
\setlength\tabcolsep{0.1pt} % default: 6pt
\begin{tabularx}{\textwidth}{ | *{7}{Y|} }
\hline
\bigstrut & addition & subtraction & multiplication & division & exponentiation & rootification \\
\hline
Vortigenu \bigstrut & \VTGN{+} & \VTGN{-} & \VTGN{*} & \VTGN{/} & \VTGN{\char"5E} & \VTGN{\char"40} \\
\hline
Earth \bigstrut & + & $-$ & $\times$ & $\div$ & ? & ? \\
\hline
\end{tabularx}
\endgroup
\end{document}
Addendum: I just noticed that you posted the following definition of the \VTGN
macro:
\newcommand{\VTGN}[1]{\setmainfont{Vortigenu}{#1}\setmainfont{Times New Roman}}
Using \setmainfont
in this manner is rather inefficient as well as quite complex; see Section 5 of the user guide of the fontspec package for a more in-depth explanation of this claim. I suggest you provide the following commands in the preamble:
\newfontfamily\vtgn{Vortigenu}
\newcommand\VTGN[1]{{\vtgn #1}} % Note the double curly braces
This definition of \VTGN
makes it unnecessary to execute \setmainfont
twice. Moreover, it works without having to know what the main document font happens to be.
Best Answer
If
\multicolumn
span is wider than the columns it spans then all the extra width goes into the last spanned column. This is a feature of the underlying\halign
primitive. One solution is to make the intercolumn space wider but shrinkable so that the default sum of the column widths is always greater then the span width. this looks better though if you don't have vertical lines.I also corrected the
\center
to\centering
and added a necessary preamble.