summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/vtable
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/vtable
Initial commit
Diffstat (limited to 'macros/latex/contrib/vtable')
-rw-r--r--macros/latex/contrib/vtable/README12
-rw-r--r--macros/latex/contrib/vtable/vtable.pdfbin0 -> 58520 bytes
-rw-r--r--macros/latex/contrib/vtable/vtable.sty233
-rw-r--r--macros/latex/contrib/vtable/vtable.tex240
4 files changed, 485 insertions, 0 deletions
diff --git a/macros/latex/contrib/vtable/README b/macros/latex/contrib/vtable/README
new file mode 100644
index 0000000000..dac3f44caa
--- /dev/null
+++ b/macros/latex/contrib/vtable/README
@@ -0,0 +1,12 @@
+Package vtable allow vertical alignement of table cell by providing:
+ * Z, L, C, R, J and I column types
+ * \nextRow and \lb commands
+ * \setMultiColRow, \setMultiColumn, \setMultiRow and \tableFormatedCell commands
+for tabular and similar environment.
+
+Version 1.0 (2019-05-13): first public release
+
+
+Copyright (C) 2015-2019, Robert Ryszard Paciorek <rrp@opcode.eu.org>
+
+This is free software distributed under terms of The MIT License.
diff --git a/macros/latex/contrib/vtable/vtable.pdf b/macros/latex/contrib/vtable/vtable.pdf
new file mode 100644
index 0000000000..2ca46722ec
--- /dev/null
+++ b/macros/latex/contrib/vtable/vtable.pdf
Binary files differ
diff --git a/macros/latex/contrib/vtable/vtable.sty b/macros/latex/contrib/vtable/vtable.sty
new file mode 100644
index 0000000000..259f6ab3d5
--- /dev/null
+++ b/macros/latex/contrib/vtable/vtable.sty
@@ -0,0 +1,233 @@
+% Copyright (c) 2015-2019 Robert Ryszard Paciorek <rrp@opcode.eu.org>
+%
+% MIT License
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the "Software"), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+
+% Version 1.0 (2019-05-13): first public release
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{vtable}
+
+\RequirePackage{array,varwidth}
+\RequirePackage{dashrule,graphicx} % for I type
+\RequirePackage{xparse,etoolbox,calc,forloop,alphalph}
+
+\newlength {\vtable@RowHeight} % current height of row (can be increase in next cells)
+\newlength {\vtable@RowInitHeight} % init height of row (loaded from aux file)
+\newlength {\vtable@RowForceHeight} % enforced value of row height
+\newlength {\vtable@RowTmpHeight}
+\newcounter{vtable@CurrRow} % current row number (file global value)
+\newcounter{vtable@CurrColumn} % current column number (reset on each new row)
+\newcounter{vtable@State} % set to 1 when finish / start new row
+\newcounter{vtable@LastRow} % set to non zero on last row of multirow cell in \vtable@PreRow, clear in \vtable@PostRow
+\newcounter{vtable@RowIter} % temporary counter used in \vtable@PostRow
+\newsavebox{\vtable@CellBox}
+\newsavebox{\vtable@CellVBox}
+
+\setcounter{vtable@State}{1}
+
+\newcommand{\vtable@PreRow}{%
+ \stepcounter{vtable@CurrRow}%
+ \setcounter{vtable@CurrColumn}{1}%
+ \setcounter{vtable@State}{0}%
+ \typeout{BEGIN ROW : \the\value{vtable@CurrRow}}%
+ \global\vtable@RowHeight=0pt%
+ \global\vtable@RowForceHeight=0pt%
+ \ifcsname tabRowHeight@\AlphAlph{\value{vtable@CurrRow}}\endcsname%
+ \global\vtable@RowInitHeight=\csname tabRowHeight@\AlphAlph{\value{vtable@CurrRow}}\endcsname%
+ \else%
+ \global\vtable@RowInitHeight=0pt%
+ \fi%
+}
+\newcommand{\vtable@PostRow}{
+ \typeout{ do post row stuff }
+ \ifdim\vtable@RowForceHeight=0pt\else\vtable@RowHeight=\vtable@RowForceHeight\fi%
+ \csdimgdef{tabRowHeight@\AlphAlph{\value{vtable@CurrRow}}}{\vtable@RowHeight}%
+ \immediate\write\@auxout{%
+ \string\newdimen\string\tabRowHeight@\AlphAlph{\value{vtable@CurrRow}}%
+ \string\global\string\tabRowHeight@\AlphAlph{\value{vtable@CurrRow}}=\the\vtable@RowHeight%
+ }%
+}
+
+% START TABLE CELL
+% \vtable@PreCell{max width}{min width}{hmode}{col num}{vmode}
+% hmode = l (left) c (center) r (right) j (justify)
+% vmode = t (top) m (middle) b (bottom)
+\DeclareDocumentCommand{\vtable@PreCell}{m m m m m}{%
+ % if starting first cell in do pre row stuff
+ \ifnumcomp{\value{vtable@State}}{=}{1}{ \vtable@PreRow }{}%
+
+ \typeout{CELL(\the\value{vtable@CurrRow},\the\value{vtable@CurrColumn}):}
+ % start "varwidth" box in "lrbox" enviroment
+ \begin{lrbox}{\vtable@CellBox}\begin{varwidth}[b]{#1}%
+ % \\ will be always \nextRow
+ \let\\\nextRow%
+ \newcommand{\nextRow}{\typeout{ finish row}\setcounter{vtable@State}{1}\tabularnewline}
+ % \lb can be used for line break
+ \let\lb\linebreak%
+ % if provide minimal width
+ \ifstrequal{#2}{}{}{%
+ % add space (with this width) in hidden row
+ \settototalheight{\vtable@RowTmpHeight}{A}\hspace*{#2}\vspace{-\vtable@RowTmpHeight}\linebreak{}%
+ }%
+ % set ragged of varwidth content and vertical space before and after varwidth
+ \ifstrequal{#3}{l}{ \raggedright \gdef\vtableCell@HPre{0} \gdef\vtableCell@HPost{1}}{%
+ \ifstrequal{#3}{c}{ \centering \gdef\vtableCell@HPre{1} \gdef\vtableCell@HPost{1}}{%
+ \ifstrequal{#3}{r}{ \raggedleft \gdef\vtableCell@HPre{1} \gdef\vtableCell@HPost{0}}{%
+ \ifstrequal{#3}{j}{ \gdef\vtableCell@HPre{0} \gdef\vtableCell@HPost{1}}{%
+ }}}}%
+ \gdef\vtable@CellVMode{#5}
+ %
+ % if this is multirow cell
+ \ifcsname tabMultirowFirst@\the\value{vtable@CurrColumn}\endcsname%
+ % if it's last row of multirow
+ \typeout{ in multi row mode, end at \csname tabMultirowLast@\the\value{vtable@CurrColumn}\endcsname row }
+ \ifnumcomp{\value{vtable@CurrRow}}{=}{\csname tabMultirowLast@\the\value{vtable@CurrColumn}\endcsname}{%
+ \typeout{ last row of multirow cell}
+ \setcounter{vtable@LastRow}{\csname tabMultirowLast@\the\value{vtable@CurrColumn}\endcsname}
+ % print content in current cell and forgot it
+ \csname tabMultirowText@\the\value{vtable@CurrColumn}\endcsname%
+ \csundef{tabMultirowText@\the\value{vtable@CurrColumn}}%
+ }{}%
+ \csnumgdef{vtable@ColSpan@\the\value{vtable@CurrColumn}}{\csname tabMultirowColSpan@\the\value{vtable@CurrColumn}\endcsname}%
+ \else
+ % set colspan value for tablePostCell macro
+ \csnumgdef{vtable@ColSpan@\the\value{vtable@CurrColumn}}{#4}
+ \fi%
+ \typeout{ colspan: \csname vtable@ColSpan@\the\value{vtable@CurrColumn}\endcsname }
+}
+
+% FINISH TABLE CELL
+\DeclareDocumentCommand{\vtable@PostCell}{}{%
+ \@finalstrut\@arstrutbox\end{varwidth}\end{lrbox}%
+ % get height of current cell
+ \settototalheight{\vtable@RowTmpHeight}{\usebox{\vtable@CellBox}}%
+ \dimdef{\multirowHeight}{0pt}%
+ %
+ % if it's last row of multirow
+ \ifnumcomp{\value{vtable@LastRow}}{=}{0}{}{%
+ % calculate \multirowHeight
+ \forloop{vtable@RowIter}{\csname tabMultirowFirst@\the\value{vtable@CurrColumn}\endcsname}{\value{vtable@RowIter} < \value{vtable@LastRow}}{%
+ \dimdef{\multirowHeight}{\multirowHeight + \csname tabRowHeight@\AlphAlph{\value{vtable@RowIter}}\endcsname + 5pt}% TODO
+ }%
+ % remove declare of multirow
+ \csundef{tabMultirowFirst@\the\value{vtable@CurrColumn}}%
+ \csundef{tabMultirowLast@\the\value{vtable@CurrColumn}}%
+ \csundef{tabMultirowForceHeight@\the\value{vtable@CurrColumn}}%
+ \setcounter{vtable@LastRow}{0}%
+ }%
+ %
+ % calculate max height of cell in current row
+ \setlength{\vtable@RowHeight}{\maxof{\vtable@RowHeight}{\vtable@RowTmpHeight - \multirowHeight}}%
+ % this must be global
+ \global\vtable@RowHeight=\vtable@RowHeight%
+ % calculate height of placeholders in current run
+ \typeout{ max(\the\vtable@RowHeight, \the\vtable@RowInitHeight) + \multirowHeight{} - \the\vtable@RowTmpHeight}%
+ \setlength{\vtable@RowTmpHeight}{\maxof{\vtable@RowHeight}{\vtable@RowInitHeight} + \multirowHeight - \vtable@RowTmpHeight}%
+ % if vertical centering we need 1/2 \vtable@RowTmpHeight
+ \ifdefstring{\vtable@CellVMode}{m}{\setlength{\vtable@RowTmpHeight}{0.5\vtable@RowTmpHeight}}{}%
+ %
+ % prepare vbox with (erlier prepared) varwidth and vertical placeholder
+ \begin{lrbox}{\vtable@CellVBox}\vbox{%
+ % in b and c (but not t) mode add vspce before content
+ \ifdefstring{\vtable@CellVMode}{t}{}{\vspace*{\vtable@RowTmpHeight}}\vspace*{4pt}% TODO
+ \hbox{\usebox{\vtable@CellBox}}%
+ % in t and c (but not b) mode add vspce after content, \vspace*{0pt} is important
+ \ifdefstring{\vtable@CellVMode}{b}{\vspace*{0pt}}{\vspace*{\vtable@RowTmpHeight}}\vspace*{-4pt}% TODO
+ }\end{lrbox}%
+ % if this is multirow cell, update saved height of content
+ \ifdim\multirowHeight=0pt\else \ht\vtable@CellVBox=0pt \dp\vtable@CellVBox=0pt \fi
+ %
+ % filling space on left (varwidth alignment)
+ \hspace{\stretch{\vtableCell@HPre}}%
+ % print prepared vbox
+ \usebox{\vtable@CellVBox}
+ % filling space on right (varwidth alignment)
+ \hspace{\stretch{\vtableCell@HPost}}%
+ %
+ % increase column counter
+ \addtocounter{vtable@CurrColumn}{\csname vtable@ColSpan@\the\value{vtable@CurrColumn}\endcsname}
+ % if finishing last cell in row do post row stuff
+ \ifnumcomp{\value{vtable@State}}{=}{1}{ \vtable@PostRow }{}%
+}
+
+% we need j type for using as base column in Z-type, this is placeholder
+\newcolumntype{j}{l}
+
+% Z{max width}{min width}{hmode}{col num}{vmode}{rown num}
+% hmode = l (left) c (center) r (right) j (justify)
+% vmode = t (top) m (middle) b (bottom)
+% use hmode as base columnt type for correct working in multicolumn
+\newcolumntype{Z}[6]{>{\vtable@PreCell{#1}{#2}{#3}{#4}{#5}}#3<{\vtable@PostCell}}
+
+
+\newcolumntype{L}[3]{Z{#1}{#2}{l}{1}{#3}{1}}
+\newcolumntype{C}[3]{Z{#1}{#2}{c}{1}{#3}{1}}
+\newcolumntype{R}[3]{Z{#1}{#2}{r}{1}{#3}{1}}
+\newcolumntype{J}[3]{Z{#1}{#2}{j}{1}{#3}{1}}
+
+% force current row height
+\newcommand{\forceRowHeight}[1]{\global\vtable@RowForceHeight=#1}
+
+% \tableFormatedCell{max width}[min width]{hmode}{vmode}
+% hmode = l (left) c (center) r (right) j (justify)
+% vmode = t (top) m (middle) b (bottom)
+\DeclareDocumentCommand{\tableFormatedCell}{m O{} m m}{
+ \@finalstrut\@arstrutbox\end{varwidth}\end{lrbox}%
+ \vtable@PreCell{#1}{#2}{#3}{1}{#4}%
+}
+
+% \setMultiColumn{col num}{max width}{min width}{hmode}{vmode}{left sep}{right sep}{text}
+% hmode = l (left) c (center) r (right) j (justify)
+% vmode = t (top) m (middle) b (bottom)
+\newcommand{\setMultiColumn}[8]{\multicolumn{#1}{#6Z{#2}{#3}{#4}{#1}{#5}{1}#7}{#8}}
+
+% \setMultiRow{col num}[minimal height]{text}
+\DeclareDocumentCommand{\setMultiRow}{m O{0pt} m O{1}}{%
+ \typeout{multi row: #1 #2 #4 in column \the\value{vtable@CurrColumn} row \the\value{vtable@CurrRow}}%
+ \csnumgdef{tabMultirowFirst@\the\value{vtable@CurrColumn}}{\value{vtable@CurrRow}}%
+ \csnumgdef{tabMultirowLast@\the\value{vtable@CurrColumn}}{\value{vtable@CurrRow} + #1 - 1}%
+ \csdimgdef{tabMultirowForceHeight@\the\value{vtable@CurrColumn}}{#2}%
+ \csnumgdef{tabMultirowColSpan@\the\value{vtable@CurrColumn}}{#4}%
+ \csnumgdef{vtable@ColSpan@\the\value{vtable@CurrColumn}}{#4}%
+ \csgdef{tabMultirowText@\the\value{vtable@CurrColumn}}{#3}%
+}
+
+% \setMultiColRow{col num}{row num}{max width}{min width}{hmode}{vmode}{left sep}{right sep}{text}
+% hmode = l (left) c (center) r (right) j (justify)
+% vmode = t (top) m (middle) b (bottom)
+\newcommand{\setMultiColRow}[9]{
+ \multicolumn{#1}{#7Z{#3}{#4}{#5}{#1}{#6}{#2}#8}{%
+ \ifstrequal{#9}{}{}{\setMultiRow{#2}{#9}[#1]}%
+ }
+}
+
+
+% I-type column put vertical frame line using hdashrule
+\newcolumntype{I}[3]{!{%
+ \setlength{\vtable@RowTmpHeight}{\vtable@RowInitHeight + 5pt}% TODO
+ \begin{lrbox}{\vtable@CellVBox}%
+ \rotatebox{90}{\hspace*{-4pt}#1\hdashrule{\vtable@RowTmpHeight}{#2}{#3}}% TODO
+ \end{lrbox}%
+ \ht\vtable@CellVBox=0pt%
+ \dp\vtable@CellVBox=0pt%
+ \usebox{\vtable@CellVBox}%
+}}
diff --git a/macros/latex/contrib/vtable/vtable.tex b/macros/latex/contrib/vtable/vtable.tex
new file mode 100644
index 0000000000..6e4ab8df9e
--- /dev/null
+++ b/macros/latex/contrib/vtable/vtable.tex
@@ -0,0 +1,240 @@
+% Copyright (c) 2015-2019 Robert Ryszard Paciorek <rrp@opcode.eu.org>
+%
+% MIT License
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the "Software"), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+
+\documentclass[a4paper]{article}
+
+\usepackage{vtable,hhline,xcolor}
+\usepackage{fvextra,geometry,lipsum}
+\fvset{breaklines=true, breakafter={/\}\{}, breakaftersymbolpre={}, breakaftersymbolpost={\tiny\ensuremath{\ \hookrightarrow\ }}}
+\geometry{tmargin=20mm, bmargin=27mm, lmargin=21mm, rmargin=21mm}
+
+\begin{document}
+
+\title{The \texttt{vtable} package}
+\author{Robert Ryszard Paciorek <rrp@opcode.eu.org>}
+\date{2019-05-13}
+\maketitle
+
+\section{Introduction}
+
+This package allow vertical alignement of table cell
+ by providing \texttt{Z}, \texttt{L}, \texttt{C}, \texttt{R}, \texttt{J} and \texttt{I} column types
+ and \Verb$\nextRow$, \Verb$\lb$, \Verb$\setMultiColRow$, \Verb$\setMultiColumn$, \Verb$\setMultiRow$ and \Verb$\tableFormatedCell$ commands
+ for \texttt{tabular} and similar environment.
+
+\section{Column types}
+
+\subsection{\texttt{Z}}
+
+\texttt{Z} column type have 6 arguments:
+\begin{enumerate}
+ \item max width of cell
+ \item min width of cell (optional – can be empty)
+ \item horizontal align mode, supported values:
+ \begin{description}
+ \item[l] left
+ \item[c] center
+ \item[r] right
+ \item[j] justify
+ \end{description}
+ \item number of columns to span this cell
+ \item vertical align mode, supported values:
+ \begin{description}
+ \item[t] top
+ \item[m] middle
+ \item[b] bottom
+ \end{description}
+ \item number of rows to span this cell
+\end{enumerate}
+
+\subsection{\texttt{L}, \texttt{C}, \texttt{R} and \texttt{J}}
+
+\texttt{L}, \texttt{C}, \texttt{R} and \texttt{J} column types are shortcuts for Z column type and have 3 arguments:
+\begin{enumerate}
+ \item max width of cell
+ \item min width of cell (optional – can be empty)
+ \item vertical align mode, supported values:
+ \begin{description}
+ \item[t] top
+ \item[m] middle
+ \item[b] bottom
+ \end{description}
+\end{enumerate}
+\texttt{L} is left ragged column, \texttt{C} is center ragged column, \texttt{R} is right ragged column and \texttt{J} is justifying column.
+
+\subsection{\texttt{I}}
+
+\texttt{I} column type insert vertical frame line and have 3 arguments:
+\begin{enumerate}
+ \item formatting command (eg. \Verb$\color$)
+ \item line width, second argument of \Verb$\hdashrule$
+ \item line style, third argument of \Verb$\hdashrule$
+\end{enumerate}
+
+
+\section{Commands}
+
+\subsection{nextRow an lb}
+{\bfseries Each row (even last) MUST be ended with \Verb$\nextRow$ command} (insted of \Verb$\\$ or \Verb$\tabularnewline$).
+Line break in table cell can be do with \Verb$\lb$ (shortcut for \Verb$\linebreak$), \Verb$\linebreak$ or \Verb$\newline$.
+
+\subsection{setMultiColRow}
+\Verb$\setMultiColRow{col num}{row num}{max width}{min width}{hmode}{vmode}{left sep}{right sep}{text}$ command allow span cells on rows and columns create multi column at the same time.
+It have 9 arguments:
+\begin{description}
+ \item[col num] number of columns to span this cell
+ \item[row num] number of rows to span this cell
+ \item[max width] max width of cell
+ \item[min width] min width of cell (optional – can be empty)
+ \item[hmode] horizontal align mode, supported values:
+ \begin{description}
+ \item[l] left
+ \item[c] center
+ \item[r] right
+ \item[j] justify
+ \end{description}
+ \item[vmode] vertical align mode, supported values:
+ \begin{description}
+ \item[t] top
+ \item[m] middle
+ \item[b] bottom
+ \end{description}
+ \item[left sep] left cell frame element
+ \item[right sep] right cell frame element
+ \item[text] cell content
+\end{description}
+
+\Verb$\setMultiColRow$ command MUST be repeated in each row of multirow set.
+Only first call CAN (and MUST) have not empty last argument (cell content).
+Every next call of \Verb$\setMultiColRow$ in single multirow set MUST have empty last argument (cell content).
+
+\subsection{setMultiColumn}
+\Verb$\setMultiColumn{col num}{max width}{min width}{hmode}{vmode}{left sep}{right sep}{text}$ command allow create multi column cell.
+It have 8 arguments meaningful as corresponding args in \Verb$\setMultiColRow$ command.
+
+\subsection{setMultiRow}
+\Verb$\setMultiRow{col num}[minimal height]{text}$ command allow create multi row cell.
+Next cells in multirow set should be empty.
+Horizontal lines between cells in multirow set should be manualy removed (via setting \Verb$\hhline$ parametrs).
+
+\subsection{tableFormatedCell}
+\Verb$\tableFormatedCell{max width}[min width]{hmode}{vmode}$ command allow change formatting for single cell.
+It have 4 arguments meaningful as corresponding args in \Verb$\setMultiColRow$ command.
+
+\subsection{forceRowHeight}
+\Verb$\forceRowHeight{value}$ enforce current row minimum height to value.
+
+
+\section{Examples}
+
+\begin{center}
+\begin{tabular}{
+ | C{2cm}{}{t} | C{2cm}{1.5cm}{m} | C{2cm}{}{b} | L{2cm}{}{m} |
+ R{2cm}{}{t} | J{2cm}{}{t} I{\color{red}}{1pt}{0.5mm 0.5mm 0.5mm 0mm}
+ }
+ \hline
+ top & middle & bottom & middle left & top right & top justify
+ \nextRow \hline
+ A \lb xxx \lb X & B & C &
+ \setMultiRow{3}{ -- \lipsum[1][1] -- \lb -- \lipsum[1][2] -- } &
+ q & q
+ \nextRow \hhline{---~--}
+ D \lb d & E \lb xxx xx \lb X \lb X & F \lb f & & q & q
+ \nextRow \hhline{---~--}
+ G & H & I \lb xxx \lb Xj & & q & q
+ \nextRow \hline
+ G &
+ \setMultiColumn{2}{4cm}{3cm}{c}{t}{}{|} {top, center: \lb \lipsum[1][3]} &
+ xx & q & q
+ \nextRow \hline
+ G &
+ \multicolumn{2}{Z{4cm}{3cm}{l}{2}{t}{1}|} {top, left: \lb \lb \lipsum[1][4]} &
+ LL LL\lb xxx\lb X\lb X & RR RR\lb xxx\lb X\lb X & BB BB\lb xxx\lb X\lb X
+ \nextRow \hline
+ G &
+ \tableFormatedCell{3.5cm}[3cm]{r}{b}I I \lb xxxxxxx \lb a a Xj &
+ y & \lipsum[1][1] & \lipsum[1][1] & \lipsum[1][1]
+ \nextRow \hline
+\end{tabular}
+\end{center}
+
+\begin{Verbatim}
+\begin{tabular}{
+ | C{2cm}{}{t} | C{2cm}{1.5cm}{m} | C{2cm}{}{b} | L{2cm}{}{m} |
+ R{2cm}{}{t} | J{2cm}{}{t} I{\color{red}}{1pt}{0.5mm 0.5mm 0.5mm 0mm}
+ }
+ \hline
+ top & middle & bottom & middle left & top right & top justify
+ \nextRow \hline
+ A \lb xxx \lb X & B & C &
+ \setMultiRow{3}{ -- \lipsum[1][1] -- \lb -- \lipsum[1][2] -- } &
+ q & q
+ \nextRow \hhline{---~--}
+ D \lb d & E \lb xxx xx \lb X \lb X & F \lb f & & q & q
+ \nextRow \hhline{---~--}
+ G & H & I \lb xxx \lb Xj & & q & q
+ \nextRow \hline
+ G &
+ \setMultiColumn{2}{4cm}{3cm}{c}{t}{}{|} {top, center: \lb \lipsum[1][3]} &
+ xx & q & q
+ \nextRow \hline
+ G &
+ \multicolumn{2}{Z{4cm}{3cm}{l}{2}{t}{1}|} {top, left: \lb \lb \lipsum[1][4]} &
+ LL LL\lb xxx\lb X\lb X & RR RR\lb xxx\lb X\lb X & BB BB\lb xxx\lb X\lb X
+ \nextRow \hline
+ G &
+ \tableFormatedCell{3.5cm}[3cm]{r}{b}I I \lb xxxxxxx \lb a a Xj &
+ y & \lipsum[1][1] & \lipsum[1][1] & \lipsum[1][1]
+ \nextRow \hline
+\end{tabular}
+\end{Verbatim}
+
+\subsection{multicolumn, multirow}
+
+\begin{center}
+\begin{tabular}{| C{2cm}{}{t} | C{2cm}{}{m} | C{2cm}{}{b} | L{2cm}{}{m} |}
+ \hline
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{ multi multi multi multi multi multi multi multi multi } & c1 & d1
+ \nextRow\hhline{~~--}
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{} & c2 & d2
+ \nextRow\hhline{~~--}
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{} & c3 & d3
+ \nextRow\hline
+ a4 & b4 & c4 & d4
+ \nextRow\hline
+\end{tabular}
+\end{center}
+
+\begin{Verbatim}
+\begin{tabular}{| C{2cm}{}{t} | C{2cm}{}{m} | C{2cm}{}{b} | L{2cm}{}{m} |}
+ \hline
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{ multi multi multi multi multi multi multi multi multi } & c1 & d1
+ \nextRow\hhline{~~--}
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{} & c2 & d2
+ \nextRow\hhline{~~--}
+ \setMultiColRow{2}{3}{4cm}{3cm}{c}{m}{|}{|}{} & c3 & d3
+ \nextRow\hline
+ a4 & b4 & c4 & d4
+ \nextRow\hline
+\end{tabular}
+\end{Verbatim}
+\end{document}