Graphics, Figures & Tablesadding vertical space in table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sainistar
Posts: 4
Joined: Mon Sep 19, 2011 12:55 am

adding vertical space in table

Post by sainistar »

Code: Select all

\begin{table}[t]
	\centering
    \begin{tabular}{|l|l|}
        \hline
        A        &  B     \\ \hline
        $S^O_w$  &  1.18  \\ \hline
        $S^I_s$  &  1.49 	\\
        \hline
    \end{tabular}
\end{table}
The above code produces the figure below
Image
The superscript and subscript are touching the line. Is there any way to add space between them and the line?

I have tried the [3pt] in the following code

Code: Select all

\begin{table}[t]
	\centering
    \begin{tabular}{|l|l|}
        \hline \\[3pt]
        A        &  B     \\[3pt] \hline \\[3pt]
        $S^O_w$  &  1.18  \\[3pt] \hline  \\[3pt]
        $S^I_s$  &  1.49 	\\[3pt]
        \hline
    \end{tabular}
\end{table}
which result in
Image
But the line break on the right side
Thanks in advance
Aman

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

adding vertical space in table

Post by Stefan Kottwitz »

Hi Aman,

you could redefine \arraystretch factor. Its default value is 1. For keeping the effect local, use it within the table environment:

Code: Select all

\begin{table}[ht]
  \renewcommand*{\arraystretch}{1.4}
   \centering
    \begin{tabular}{|l|l|}
        \hline
        A        &  B     \\ \hline
        $S^O_w$  &  1.18  \\ \hline
        $S^I_s$  &  1.49    \\
        \hline
    \end{tabular}
\end{table}
table.png
table.png (3.68 KiB) Viewed 43733 times
Stefan
LaTeX.org admin
sainistar
Posts: 4
Joined: Mon Sep 19, 2011 12:55 am

Re: adding vertical space in table

Post by sainistar »

Thanks Stefan. It works.
Post Reply