Search In This Website

Jumat, 06 Desember 2024

Tables In Latex 1

Learning Objective:

To increase the table row height in Latex.

Ordinary Syntax

 \begin{tabular}[pos]{cols}
 column 1 entry & column 2 entry ... & column n entry \\
 .
 .
 .
 \end{tabular}

Exercise

1. Type this following latex code in latex editor:
% !TEX TS-program=pdflatex
%% File Description:
%% Increase the height of table row
\documentclass[a4paper,12pt]{book}

% Loading the package
%---------------------------
\usepackage{fouriernc}
\usepackage{array}
%---------------------------

\begin{document}
%% Table 1
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|} \hline
%% Table Header
%---------------------------
  \begin{tabular}{l}
  \textbf{Name}
  \end{tabular} & 
  \begin{tabular}{l}
  \textbf{Exam}
  \end{tabular} &
  \begin{tabular}{l}
  \textbf{Grade}
 \end{tabular}\\\hline
%---------------------------
 \begin{tabular}{l}
 Dan 
 \end{tabular} &
 \begin{tabular}{l}
 97\% 
 \end{tabular} & 
 \begin{tabular}{l}
 A 
 \end{tabular}\\\hline
\end{tabular}
\caption{Math 101 Final Grades}
\label{GradeTable1}
\end{center}
\end{table}

%% Table 2
\setlength\extrarowheight{2.5pt}
\begin{table}[h!]
\begin{center}
\begin{tabular}{|c|c|c|} \hline
%% Table Header
%---------------------------
  \begin{tabular}{l}
  \bfseries Name
  \end{tabular} & 
  \begin{tabular}{l}
  \bfseries Exam
  \end{tabular} &
  \begin{tabular}{l}
  \bfseries  Grade
 \end{tabular}\\\hline
%---------------------------
 \begin{tabular}{l}
 Dan 
 \end{tabular} &
 \begin{tabular}{l}
 97\% 
 \end{tabular} & 
 \begin{tabular}{l}
 A 
 \end{tabular}\\\hline
\end{tabular}
\caption{Math 101 Final Grades}
\label{GradeTable2}
\end{center}
\end{table}
\end{document}
2. Save file as beginnerTable1.tex
3. Then build or typeset the Latex code.

Output




Notes To see the more clear picture, click on the picture.


latex table, tabular environment, float environment, array environment

Bibliography

https://illinois.edu/ ( university )
http://latex.org/
https://stonybrook.edu/ ( university )
https://www.learnlatex.org/

Related Post

Tidak ada komentar:

Posting Komentar