General ⇒ Adjusting width of table
Adjusting width of table
This is the coding for the table i am using:
\begin{table}[H]
\begin{center}
\begin{tabular}{ | l | l | }
\hline
Test No & 1 \\ \hline
Description & Selecting continue from welcome page \\ \hline
Input & Button click \\ \hline
Result & Expected result \\ \hline
Conclusion & The button did its function and routed the user to the next page \\
\hline
\end{tabular}
\caption{Test case 1: Welcome page button}
\label{tb:Test case 1: Welcome page button}
\end{center}
\end{table}
Where would i need to apply the neccessary coding:
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Adjusting width of table
Code: Select all
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}[H]
\setlength\extrarowheight{3pt}
\centering
\begin{tabular}{|p{2cm}|p{5cm}|}
\hline
Test No & 1 \\ \hline
Description & Selecting continue from welcome page \\ \hline
Input & Button click \\ \hline
Result & Expected result \\ \hline
Conclusion & The button did its function and routed the user to the next page \\
\hline
\end{tabular}
\caption{Test case 1: Welcome page button}
\label{tb:Test_case_1}
\end{table}
%requires the array package
\begin{table}[H]
\setlength\extrarowheight{3pt}
\centering
\begin{tabular}{|m{2cm}|m{5cm}|}
\hline
Test No & 1 \\ \hline
Description & Selecting continue from welcome page \\ \hline
Input & Button click \\ \hline
Result & Expected result \\ \hline
Conclusion & The button did its function and routed the user to the next page \\
\hline
\end{tabular}
\caption{Test case 2: Welcome page button}
\label{tb:Test_case_2}
\end{table}
\end{document}
Re: Adjusting width of table
\caption{xyz}
\label{tb:xyz}
Adjusting width of table
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Adjusting width of table
Basic LaTeX documentation is available with lshort and l2tabu. Useful hints about float environments can be found in epslatex.ma501th wrote:Could you please tell the difference between the following two line of codes
\caption{xyz}
\label{tb:xyz}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10