You are on page 1of 6

BNG V GI LNH LIN QUAN

Nguyn Hu in
Khoa Ton - C - Tin hc
i hc khoa hc t nhin, HQG HN

Gi lnh makecell.sty

Gi lnh makecell.sty do Olga Lapko to ra c ti a ch


http://tug.ctan.org/tex-archive/macros/latex/contrib/makecell/
Lnh c bn ca gi ny l
\makecell[<Sp xp>]{Vn bn c th ngt xung dng} thng qua v d cc
bn c m ngun s hiu

\begin{tabular}{|c|c|}
\hline
Cell text & 28--31\\
\hline
\makecell{Nhiu dng \\ mt } & 28--31\\
\hline
\makecell[l]{Dt tri \\ vn bn ca } & 37--43\\
\hline
\makecell*[r]{Dt phi\\ vn bn ca } & 37--43\\
\hline
\makecell[b]{Dng t dng di \\ vn bn ca } & 52--58\\
\hline
\makecell*[{{p{3cm}}}]{ nhiu vn bn xc nh di} & 52--58\\
\hline
\makecell[{{>{\parindent1em}p{3cm}}}]
{ nhiu vn bn xc nh di} & 52--58\\
\hline
\end{tabular}

Cell text
Nhiu dng
mt
Dt tri
vn bn ca
Dt phi
vn bn ca
Dng t dng di
vn bn ca

2831
2831
3743
3743
5258

nhiu vn bn
xc nh di

5258

nhiu vn
bn xc nh
di

5258

- Mt lnh khc tng t \thead{Ct u th nht}


\renewcommand\theadset{\def\arraystretch{.85}}%
\begin{tabular}{|l|c|}
\hline
\thead{Ct u th nht}&
\thead{Ct hai \\ nhiu dng\\ cng u }\\
\hline
Ni dung vn bn& 28--31\\
\hline
\end{tabular}

Ct u th nht

Ct hai
nhiu dng
cng u

Ni dung vn bn

2831

- Kt hp vi gi \usepackage{rotating} v lnh \rothead{}


\settowidth\rotheadsize{\theadfont Chiu cao ca ct th hai}
\begin{tabular}{|l|c|}
\hline
\thead{u ct th nht}&
\rothead{Ct th hai nhiu dng \\ u dng hai}\\
\hline
Ct vn bn bn tri & 28--31\\
\hline
\end{tabular}

Ct vn bn bn tri

Ct th hai nhiu dng


u dng hai

u ct th nht

2831

- K ng cho u tin
\diaghead(H t l cao,V t l ngang){Vn bn hoc di ct}%
{u gc 1}{u gc 2}
Thng qua v d
\begin{tabular}{|c|c|c|}%
\hline
\diaghead{\theadfont Diag ColumnmnHead II}%^^A
{Diag \\Column Head I}{Diag Column\\ Head II}&
\thead{Second\\column}&\thead{Third\\column}\\
\hline
\makecell[l]{Left aligned \\ cell text}
& A & 37--43\\
\hline
\makecell*[r]{Right aligned \\ cell text} & B & 37--43\\
\hline
\makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\
\hline
\end{tabular}%
aa
aa Diag Column
aa Head II Second
aa
Diag
column
Column Head I aa
a

Left aligned
cell text
Right aligned
cell text
Bottom aligned
cell text

Third
column

3743

3743

5258

\begin{tabularx}{.62\hsize}{|X|c|c|}%
\hline
\diaghead(4,1){\hskip\hsize}%
%^^A{\theadfont Diag ColuDiag Column}%^^A

{Diag \\Column Head I}{Diag Column \\Head II}&


\thead{Second\\column}&\thead{Third\\column}\\
\hline
\makecell[l]{Left aligned \\ cell text}
& A & 37--43\\
\hline
\makecell*[r]{Right aligned \\ cell text} & B & 37--43\\
\hline
\makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\
\hline
\end{tabularx}%




Second

Diag column


Column Head I


Diag Column
Head II

Left aligned
cell text
Right aligned
cell text
Bottom aligned
cell text

Third
column

3743

3743

5258

\begin{tabular}{|l|c|c|}%
\hline
\diaghead(-4,1){\hskip4.2cm}%^^A
{Diag \\Column Head I}{Diag Column \\Head II}&
\thead{Second\\column}&\thead{Third\\column}\\
\hline
\makecell[l]{Left aligned \\ cell text}
& A & 37--43\\
\hline
\makecell*[r]{Right aligned \\ cell text} & B & 37--43\\
\hline
\makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\
\hline
\end{tabular}%
XXX
XXX Diag Column Second
Diag
XX Head II
XXX
column
Column Head I
XX
X

Left aligned
cell text
Right aligned
cell text
Bottom aligned
cell text

Third
column

3743

3743

5258

- Bng c khung m vin


\renewcommand\theadset{\def\arraystretch{.85}}%
\renewcommand\theadgape{}
\begin{tabular}{!{\vrule width1.2pt}c
!{\vrule width1.2pt}c|c!{\vrule width1.2pt}}
\Xhline{1.2pt}
\multirowthead{4}{First Column head}&
\multicolumn{2}{c!{\vrule width1.2pt}}{\thead{Multicolumn head}}\\
\Xcline{2-3}{1.2pt}
& \thead{Second \\multlined \\ column head} &
\thead{Third \\ column head}\\
\Xhline{1.2pt}
Cell text & A &\multirowcell{4}{28--31}\\
\cline{1-2}
\makecell{Multilined \\Cell text} & B& \\
\hline
\makecell[l]{Left aligned \\ cell text} & C
& \multirowcell{4}[0ex][l]{37--43}\\
\cline{1-2}
\makecell[r]{Right aligned \\ cell text} & D & \\
\hline
\makecell[b]{Bottom aligned \\ cell text} & E &
\multirowcell{6}[0ex][r]{37--43\\52--58}\\
\cline{1-2}
\makecell[{{p{5cm}}}]{Cell long long long long long long text with
predefined width} & F & \\
\cline{1-2}
\makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long long
long text with predefined width} & G & \\
\Xhline{1.2pt}
\end{tabular}

First Column head

Cell text
Multilined
Cell text
Left aligned
cell text
Right aligned
cell text
Bottom aligned
cell text
Cell long long long long long
long text with predefined
width
Cell long long long long
long long text with predefined
width

Multicolumn head
Second
Third
multlined
column head
column head

A
B

2831

C
D

3743

E
F

3743
5258

Kt lun

VieTeX tr gip cho ngi dng thng minh hn. Cch thc tin hnh thng minh
v khai thc VieTeX th no l do ni bn. Ti tin rng VieTeX mi ngy mt thng
minh. ...

You might also like