PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/test/target/ok/table.tex

http://txt2tags.googlecode.com/
LaTeX | 185 lines | 140 code | 43 blank | 2 comment | 0 complexity | 8937bdbf3b5aa8352536040121e61df3 MD5 | raw file
  1\documentclass{article}
  2\usepackage{graphicx}
  3\usepackage{paralist} % needed for compact lists
  4\usepackage[normalem]{ulem} % needed by strike
  5\usepackage[urlcolor=blue,colorlinks=true]{hyperref}
  6
  7\begin{document}
  8\maketitle
  9\clearpage
 10
 11
 12\section*{Simple table}
 13
 14\begin{center}\begin{tabular}{lll}
 15Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 16Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 17Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 18\end{tabular}\end{center}
 19
 20\section*{Simple table + border}
 21
 22\begin{center}\begin{tabular}{|l|l|l|}
 23\hline Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 24\hline Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 25\hline Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 26\hline \end{tabular}\end{center}
 27
 28\section*{Simple table + heading}
 29
 30\begin{center}\begin{tabular}{lll}
 31\textbf{Head 1-1} & \textbf{Head 1-2} & \textbf{Head 1-3} \\
 32Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 33Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 34Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 35\end{tabular}\end{center}
 36
 37\section*{Simple table + heading + border}
 38
 39\begin{center}\begin{tabular}{|l|l|l|}
 40\hline \textbf{Head 1-1} & \textbf{Head 1-2} & \textbf{Head 1-3} \\
 41\hline Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 42\hline Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 43\hline Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 44\hline \end{tabular}\end{center}
 45
 46\section*{Simple table + heading + border + footer}
 47
 48\begin{center}\begin{tabular}{|l|l|l|}
 49\hline \textbf{Head 1-1} & \textbf{Head 1-2} & \textbf{Head 1-3} \\
 50\hline Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 51\hline Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 52\hline Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 53\hline \textbf{Foot 1-1} & \textbf{Foot 1-2} & \textbf{Foot 1-3} \\
 54\hline \end{tabular}\end{center}
 55
 56\section*{Simple table + heading + border + centralized}
 57
 58\begin{center}\begin{tabular}{|l|l|l|}
 59\hline \textbf{Head 1-1} & \textbf{Head 1-2} & \textbf{Head 1-3} \\
 60\hline Cell 1-1 & Cell 1-2 & Cell 1-3 \\
 61\hline Cell 2-1 & Cell 2-2 & Cell 2-3 \\
 62\hline Cell 3-1 & Cell 3-2 & Cell 3-3 \\
 63\hline \end{tabular}\end{center}
 64
 65\section*{Cell alignment}
 66
 67\begin{center}\begin{tabular}{|l|l|}
 68\hline ======= & ======= \\
 69\hline $<$ & \multicolumn{1}{|r|}{$>$} \\
 70\hline \multicolumn{1}{|c|}{=} & \multicolumn{1}{|c|}{=} \\
 71\hline \multicolumn{1}{|r|}{$>$} & $<$ \\
 72\hline \end{tabular}\end{center}
 73
 74\section*{Heading alignment}
 75
 76\begin{center}\begin{tabular}{|l|l|}
 77\hline \textbf{=======} & \textbf{=======} \\
 78\hline \textbf{$<$} & \multicolumn{1}{|r|}{\textbf{$>$}} \\
 79\hline \multicolumn{1}{|c|}{\textbf{=}} & \multicolumn{1}{|c|}{\textbf{=}} \\
 80\hline \multicolumn{1}{|r|}{\textbf{$>$}} & \textbf{$<$} \\
 81\hline \end{tabular}\end{center}
 82
 83\section*{Column span for cells}
 84
 85\begin{center}\begin{tabular}{|l|l|l|l|}
 86\hline 1 & 2 & 3 & 4 \\
 87\hline 1 & 2 & \multicolumn{2}{|l|}{3 + 4} \\
 88\hline \multicolumn{3}{|l|}{1 + 2 + 3} & 4 \\
 89\hline 1 & \multicolumn{2}{|l|}{2 + 3} & 4 \\
 90\hline \multicolumn{4}{|l|}{1 + 2 + 3 + 4} \\
 91\hline \end{tabular}\end{center}
 92
 93\section*{Column span for headings}
 94
 95\begin{center}\begin{tabular}{|l|l|l|l|}
 96\hline \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} \\
 97\hline \textbf{1} & \textbf{2} & \multicolumn{2}{|l|}{\textbf{3 + 4}} \\
 98\hline \multicolumn{3}{|l|}{\textbf{1 + 2 + 3}} & \textbf{4} \\
 99\hline \textbf{1} & \multicolumn{2}{|l|}{\textbf{2 + 3}} & \textbf{4} \\
100\hline \multicolumn{4}{|l|}{\textbf{1 + 2 + 3 + 4}} \\
101\hline \end{tabular}\end{center}
102
103\section*{Cell alignment + column span}
104
105\begin{center}\begin{tabular}{|l|l|l|}
106\hline ======= & ======= & ======= \\
107\hline \multicolumn{2}{|l|}{$<$} & \multicolumn{1}{|c|}{=} \\
108\hline \multicolumn{3}{|c|}{=} \\
109\hline \multicolumn{1}{|c|}{=} & \multicolumn{2}{|r|}{$>$} \\
110\hline \end{tabular}\end{center}
111
112\section*{Heading alignment + column span}
113
114\begin{center}\begin{tabular}{|l|l|l|}
115\hline \textbf{=======} & \textbf{=======} & \textbf{=======} \\
116\hline \multicolumn{2}{|l|}{\textbf{$<$}} & \multicolumn{1}{|c|}{\textbf{=}} \\
117\hline \multicolumn{3}{|c|}{\textbf{=}} \\
118\hline \multicolumn{1}{|c|}{\textbf{=}} & \multicolumn{2}{|r|}{\textbf{$>$}} \\
119\hline \end{tabular}\end{center}
120
121\section*{Some empty cells}
122
123\begin{center}\begin{tabular}{|l|l|l|l|l|}
124\hline A & B & C & D &  \\
125\hline F & G & H &  & J \\
126\hline K & L &  & N & O \\
127\hline P &  & R & S & T \\
128\hline  & V & W & X & Y \\
129\hline \end{tabular}\end{center}
130
131\section*{Lines with different number of cells, increase}
132
133\begin{center}\begin{tabular}{|l|}
134\hline 1 \\
135\hline 1 & 2 \\
136\hline 1 & 2 & 3 \\
137\hline 1 & 2 & 3 & 4 \\
138\hline 1 & 2 & 3 & 4 & 5 \\
139\hline \end{tabular}\end{center}
140
141\section*{Lines with different number of cells, decrease}
142
143\begin{center}\begin{tabular}{|l|l|l|l|l|}
144\hline 1 & 2 & 3 & 4 & 5 \\
145\hline 1 & 2 & 3 & 4 \\
146\hline 1 & 2 & 3 \\
147\hline 1 & 2 \\
148\hline 1 \\
149\hline \end{tabular}\end{center}
150
151\section*{One cell table}
152
153\begin{center}\begin{tabular}{l}
154Cell 1 \\
155\end{tabular}\end{center}
156
157\section*{One cell table + border}
158
159\begin{center}\begin{tabular}{|l|}
160\hline Cell 1 \\
161\hline \end{tabular}\end{center}
162
163\section*{One cell table + heading}
164
165\begin{center}\begin{tabular}{l}
166\textbf{Head 1} \\
167\end{tabular}\end{center}
168
169\section*{One cell table + heading + border}
170
171\begin{center}\begin{tabular}{|l|}
172\hline \textbf{Head 1} \\
173\hline \end{tabular}\end{center}
174
175\section*{Empty lines}
176
177\begin{center}\begin{tabular}{|l|}
178\hline  \\
179\hline  \\
180\hline  \\
181\hline \end{tabular}\end{center}
182
183% LaTeX2e code generated by txt2tags (http://txt2tags.org)
184% cmdline: txt2tags -q --no-rc -i table.t2t -t tex
185\end{document}