%2multibyte Version: 5.50.0.2960 CodePage: 65001 \documentclass[12pt,a4paper]{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{amsfonts} \usepackage{amsmath} \usepackage{jeep} \usepackage{geometry} \setcounter{MaxMatrixCols}{10} %TCIDATA{OutputFilter=LATEX.DLL} %TCIDATA{Version=5.50.0.2960} %TCIDATA{Codepage=65001} %TCIDATA{} %TCIDATA{BibliographyScheme=Manual} %TCIDATA{Created=Tuesday, March 09, 2021 21:38:06} %TCIDATA{LastRevised=Thursday, March 11, 2021 00:11:58} %TCIDATA{} %TCIDATA{} %TCIDATA{CSTFile=LaTeX article (bright).cst} \newtheorem{theorem}{Theorem} \newtheorem{acknowledgement}[theorem]{Acknowledgement} \newtheorem{algorithm}[theorem]{Algorithm} \newtheorem{axiom}[theorem]{Axiom} \newtheorem{case}[theorem]{Case} \newtheorem{claim}[theorem]{Claim} \newtheorem{conclusion}[theorem]{Conclusion} \newtheorem{condition}[theorem]{Condition} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{criterion}[theorem]{Criterion} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{exercise}[theorem]{Exercise} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{notation}[theorem]{Notation} \newtheorem{problem}[theorem]{Problem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{remark}[theorem]{Remark} \newtheorem{solution}[theorem]{Solution} \newtheorem{summary}[theorem]{Summary} \newenvironment{proof}[Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}} \geometry{left=1in,top=1.8in,bottom=1.2in} \input{tcilatex} \begin{document} \title{Tables - Automatic Width or Fixed Width} \author{Dr Christopher Mabb \\ %EndAName Scientific Word Ltd.} \date{12/3/21} \maketitle \begin{abstract} Automatic Width, according to the width of the text in the columns, is the default. Alternatively, you can specify the column width... \end{abstract} \section{Automatic Width} Let us create a simple table. By default, the column widths will be determined by the text in each column. Here we have centred the contents of most cells: \begin{center} \ \begin{tabular}{|l||c|c|c|} \hline & \textbf{Apple} & \textbf{Orange} & \textbf{Pear} \\ \hline\hline \textbf{Shape} & Round & Round & Pear-shaped \\ \hline \textbf{Colour} & Red & Orange & Green \\ \hline \textbf{Vitamin C} & 4.6mg & 53mg & 4.3mg \\ \hline \end{tabular} \end{center} \section{Fixed Width} We can change the Table to Fixed Width by highlighting\ particular columns, then right-click -- Properties -- Column width, unchecking "Use Automatic Width" and specifying the width for that column (here 1in, with the last column 2in). Note that this disables any horizontal alignment you have chosen. To see the cell contents of a Fixed Width cell, right-click \textit{either} to the right \textit{or} to the left of the TeX Field (but within that table cell), select Properties, and it will show you the Cell Contents: \begin{center} \ \begin{tabular}{|p{1in}||p{1in}|p{1in}|p{2in}|} \hline & \textbf{Apple} & \textbf{Orange} & \textbf{Pear} \\ \hline\hline \textbf{Shape} & Round & Round & Pear-shaped \\ \hline \textbf{Colour} & Red & Orange & Green \\ \hline \textbf{Vitamin C} & 4.6mg & 53mg & 4.3mg \\ \hline \end{tabular} \end{center} \section{Fixed Width with horizontal alignment} If we only apply the Fixed Width to one row (here, the top row) we can retain the ability to choose horizontal alignment for the other rows. But it does look strange to have the top line left-justified and everything else centred; notice, too, that in the PDF this introduces problems with the vertical lines between the first two columns: \begin{center} \begin{tabular}{|p{1in}||p{1in}|p{1in}|p{2in}|} \hline & \textbf{Apple} & \textbf{Orange} & \textbf{Pear} \\ \hline\hline \multicolumn{1}{|c||}{\textbf{Shape}} & \multicolumn{1}{||c|}{Round} & \multicolumn{1}{|c|}{Round} & \multicolumn{1}{|c|}{Pear-shaped} \\ \hline \multicolumn{1}{|c||}{\textbf{Colour}} & \multicolumn{1}{||c|}{Red} & \multicolumn{1}{|c|}{Orange} & \multicolumn{1}{|c|}{Green} \\ \hline \multicolumn{1}{|c||}{\textbf{Vitamin C}} & \multicolumn{1}{||c|}{4.6mg} & \multicolumn{1}{|c|}{53mg} & \multicolumn{1}{|c|}{4.3mg} \\ \hline \end{tabular} \end{center} \section{Fixed Width using a dummy row} If we\ instead apply the Fixed Width to a dummy, invisible row, we can retain the ability to choose horizontal alignment for all the other cells in the table, and we can see the contents of all the cells we wish to edit. Note that the contents of the dummy cells on the bottom row must be non-zero -- though you want them invisible (here we've used a couple of spaces, which you can see if you turn on View -- Invisibles). You will want to apply `No Line' to the left, bottom and right of the cells on the bottom row (shown in the editing window as green lines rather than black): \begin{center} \ \begin{tabular}{p{1in}p{1in}p{1in}p{2in}} \hline \multicolumn{1}{|l}{} & \multicolumn{1}{||c}{\textbf{Apple}} & \multicolumn{1}{|c}{\textbf{Orange}} & \multicolumn{1}{|c|}{\textbf{Pear}} \\ \hline\hline \multicolumn{1}{|l}{\textbf{Shape}} & \multicolumn{1}{||c}{Round} & \multicolumn{1}{|c}{Round} & \multicolumn{1}{|c|}{Pear-shaped} \\ \hline \multicolumn{1}{|l}{\textbf{Colour}} & \multicolumn{1}{||c}{Red} & \multicolumn{1}{|c}{Orange} & \multicolumn{1}{|c|}{Green} \\ \hline \multicolumn{1}{|l}{\textbf{Vitamin C}} & \multicolumn{1}{||c}{4.6mg} & \multicolumn{1}{|c}{53mg} & \multicolumn{1}{|c|}{4.3mg} \\ \hline \ & \ & \ & \ \end{tabular} \end{center} \end{document}