Jumat, 03 Januari 2025

Tables In Latex 2 Standalone

Learning Objectives: Wrap the text in the Latex table column.
1. Type this following latex code in latex editor:
% !TEX TS-program=pdflatex
%% File Name: tableFitPageSo1.tex
%% File Description:
%% Wrap the text in the Latex Table Column.
%% Fit the table to page

\documentclass[a4paper,12pt]{book}

% Loading the package
%---------------------------
\usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{0.25pt}

\usepackage{array}

%---------------------------

\begin{table}[!t]

\caption{Top Scorers}

\label{tab:topscorer}

\begin{tabular*}{\textwidth}{ l p{0.8\textwidth} }

\hline

\bf Goals & \bf Players\\

\hline

4 & First Last, First Last, First Last, First Last\\

3 & First Last\\

2 & First Last\\

1 & First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last, First Last\\

\hline

\end{tabular*}

\caption{Caption}

\label{tab:my_label}

\end{table}

\end{document}

2. Save file as tableFitPageSo1.tex

3. Then build or typeset the Latex code.

Output




< Previous Tables In Latex 2

Tidak ada komentar:

Posting Komentar