Lack of spacing in table due to text blurring into the borders












1















Following is my Latex template:



documentclass{article}
usepackage[utf8]{inputenc}

usepackage{mathtools}
usepackage{tabularx}

begin{document}

begin{table}
footnotesize
centering
begin{tabular}{|l|c|}
hline
S. No. & Analysis \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
end{tabular}
caption{Example of a table}
label{sth}
end{table}

end{document}


This generates the following table.



enter image description here



My problem is that the table looks shabby. It looks very cluttered. Is there some way to put some gap in each of the boxes between the text and the box borders. The problem is only with the elements of the second column because those have a formula with both superscript and subscript.



What is the most beautiful way to publish this table so that people can read it easily?



PS: I need to keep it to footnotesize. But I don't think that should matter. All I am asking how to put some white space around the formula in the second column so that the formula does into blend into the borders.










share|improve this question




















  • 2





    unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

    – David Carlisle
    Mar 12 at 21:54


















1















Following is my Latex template:



documentclass{article}
usepackage[utf8]{inputenc}

usepackage{mathtools}
usepackage{tabularx}

begin{document}

begin{table}
footnotesize
centering
begin{tabular}{|l|c|}
hline
S. No. & Analysis \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
end{tabular}
caption{Example of a table}
label{sth}
end{table}

end{document}


This generates the following table.



enter image description here



My problem is that the table looks shabby. It looks very cluttered. Is there some way to put some gap in each of the boxes between the text and the box borders. The problem is only with the elements of the second column because those have a formula with both superscript and subscript.



What is the most beautiful way to publish this table so that people can read it easily?



PS: I need to keep it to footnotesize. But I don't think that should matter. All I am asking how to put some white space around the formula in the second column so that the formula does into blend into the borders.










share|improve this question




















  • 2





    unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

    – David Carlisle
    Mar 12 at 21:54
















1












1








1








Following is my Latex template:



documentclass{article}
usepackage[utf8]{inputenc}

usepackage{mathtools}
usepackage{tabularx}

begin{document}

begin{table}
footnotesize
centering
begin{tabular}{|l|c|}
hline
S. No. & Analysis \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
end{tabular}
caption{Example of a table}
label{sth}
end{table}

end{document}


This generates the following table.



enter image description here



My problem is that the table looks shabby. It looks very cluttered. Is there some way to put some gap in each of the boxes between the text and the box borders. The problem is only with the elements of the second column because those have a formula with both superscript and subscript.



What is the most beautiful way to publish this table so that people can read it easily?



PS: I need to keep it to footnotesize. But I don't think that should matter. All I am asking how to put some white space around the formula in the second column so that the formula does into blend into the borders.










share|improve this question
















Following is my Latex template:



documentclass{article}
usepackage[utf8]{inputenc}

usepackage{mathtools}
usepackage{tabularx}

begin{document}

begin{table}
footnotesize
centering
begin{tabular}{|l|c|}
hline
S. No. & Analysis \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\ $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \ hline
end{tabular}
caption{Example of a table}
label{sth}
end{table}

end{document}


This generates the following table.



enter image description here



My problem is that the table looks shabby. It looks very cluttered. Is there some way to put some gap in each of the boxes between the text and the box borders. The problem is only with the elements of the second column because those have a formula with both superscript and subscript.



What is the most beautiful way to publish this table so that people can read it easily?



PS: I need to keep it to footnotesize. But I don't think that should matter. All I am asking how to put some white space around the formula in the second column so that the formula does into blend into the borders.







tables spacing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 12 at 21:43









leandriis

10.4k1531




10.4k1531










asked Mar 12 at 21:23









user_1_1_1user_1_1_1

1826




1826








  • 2





    unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

    – David Carlisle
    Mar 12 at 21:54
















  • 2





    unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

    – David Carlisle
    Mar 12 at 21:54










2




2





unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

– David Carlisle
Mar 12 at 21:54







unrelated but begin{table} means "do not allow the table anywhere" latex warns about that LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 9. but it is better to use begin{table} and avoid the warning.

– David Carlisle
Mar 12 at 21:54












3 Answers
3






active

oldest

votes


















1














I would (a) employ an array environment instead of a tabular environment for the main table, (b) I wouldn't use the 'inner' tabular environments at all, (c) I'd use the line-drawing macros of the booktabs package for fewer, but well-spaced, horizontal lines, and (d) omit all vertical lines; they're not needed -- really!



enter image description here



documentclass{article}
usepackage{booktabs} % toprule, midrule, bottomrule, addlinespace
begin{document}

begin{table}
footnotesize
centering
$begin{array}{@{}ll@{}}
toprule
mbox{S.,No.} & mbox{Analysis} \
midrule
1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
&x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
&x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \
bottomrule
end{array}$
caption{Example of a table}
label{sth}
end{table}

end{document}




Addendum to address the OP's follow-up query:




Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics?




The main point of inserting some extra vertical space between rows, via the addlinespace instructions, was to change the aesthetics, by creating a bit of "breathing space" inside the table. How to retain these aethetics while saving some vertical space isn't going to be straightforward. I suppose that executing setlength{defaultaddspace}{0.3em} immediately before $begin{array}..., and changing the two instances of \[0.5ex] to \0.3ex, should manage the preserve at least some of the aesthetics. Plus, you'll save about two rows of vertical space... The following screenshot juxtaposes the solution shown above with the one that results from reducing the value of defaultaddspace by 40%. (In case you're curious: eliminating the addlinespace directives entirely -- which would definitely affect the aesthetics in a major way! -- would save another 1 to 2 rows.)



enter image description here






share|improve this answer


























  • it was very difficult to choose one out of all the answers. i picked this one.

    – user_1_1_1
    Mar 13 at 15:19











  • Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

    – user_1_1_1
    Mar 13 at 15:53






  • 1





    @user_1_1_1 - Please see the addendum I just posted.

    – Mico
    Mar 13 at 19:21











  • Thanks. Could you take a stab at this one too?

    – user_1_1_1
    Mar 14 at 0:25



















2














With the help of the booktabs and the cellspace package you can achieve the following output:



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{mathtools}
usepackage{makecell}
usepackage{cellspace}
setlength{cellspacetoplimit}{6pt}
setlength{cellspacebottomlimit}{6pt}
begin{document}

begin{table}
footnotesize
centering
begin{tabular}{SlSc}
toprule
S. No. & Analysis \
midrule
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
$3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
$3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
bottomrule
end{tabular}
caption{Example of a table}
label{sth}
end{table}

end{document}





share|improve this answer































    2














    Is it better with the help of cellspace and makecell?



    documentclass{article}
    usepackage[utf8]{inputenc}

    usepackage{mathtools}
    usepackage{tabularx}
    usepackage[math]{cellspace}
    setlength{cellspacetoplimit}{3pt}
    setlength{cellspacebottomlimit}{3pt}

    usepackage{makecell}

    begin{document}

    begin{table}[!htb]
    footnotesize
    centering
    begin{tabular}{|l| >{$}Sc<{$}|}
    hline
    S. No. & text{Analysis} \ hline
    1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
    3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
    3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
    end{tabular}
    caption{Example of a table}
    label{sth}
    end{table}

    end{document}


    enter image description here






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479175%2flack-of-spacing-in-table-due-to-text-blurring-into-the-borders%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      I would (a) employ an array environment instead of a tabular environment for the main table, (b) I wouldn't use the 'inner' tabular environments at all, (c) I'd use the line-drawing macros of the booktabs package for fewer, but well-spaced, horizontal lines, and (d) omit all vertical lines; they're not needed -- really!



      enter image description here



      documentclass{article}
      usepackage{booktabs} % toprule, midrule, bottomrule, addlinespace
      begin{document}

      begin{table}
      footnotesize
      centering
      $begin{array}{@{}ll@{}}
      toprule
      mbox{S.,No.} & mbox{Analysis} \
      midrule
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \
      bottomrule
      end{array}$
      caption{Example of a table}
      label{sth}
      end{table}

      end{document}




      Addendum to address the OP's follow-up query:




      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics?




      The main point of inserting some extra vertical space between rows, via the addlinespace instructions, was to change the aesthetics, by creating a bit of "breathing space" inside the table. How to retain these aethetics while saving some vertical space isn't going to be straightforward. I suppose that executing setlength{defaultaddspace}{0.3em} immediately before $begin{array}..., and changing the two instances of \[0.5ex] to \0.3ex, should manage the preserve at least some of the aesthetics. Plus, you'll save about two rows of vertical space... The following screenshot juxtaposes the solution shown above with the one that results from reducing the value of defaultaddspace by 40%. (In case you're curious: eliminating the addlinespace directives entirely -- which would definitely affect the aesthetics in a major way! -- would save another 1 to 2 rows.)



      enter image description here






      share|improve this answer


























      • it was very difficult to choose one out of all the answers. i picked this one.

        – user_1_1_1
        Mar 13 at 15:19











      • Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

        – user_1_1_1
        Mar 13 at 15:53






      • 1





        @user_1_1_1 - Please see the addendum I just posted.

        – Mico
        Mar 13 at 19:21











      • Thanks. Could you take a stab at this one too?

        – user_1_1_1
        Mar 14 at 0:25
















      1














      I would (a) employ an array environment instead of a tabular environment for the main table, (b) I wouldn't use the 'inner' tabular environments at all, (c) I'd use the line-drawing macros of the booktabs package for fewer, but well-spaced, horizontal lines, and (d) omit all vertical lines; they're not needed -- really!



      enter image description here



      documentclass{article}
      usepackage{booktabs} % toprule, midrule, bottomrule, addlinespace
      begin{document}

      begin{table}
      footnotesize
      centering
      $begin{array}{@{}ll@{}}
      toprule
      mbox{S.,No.} & mbox{Analysis} \
      midrule
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \
      bottomrule
      end{array}$
      caption{Example of a table}
      label{sth}
      end{table}

      end{document}




      Addendum to address the OP's follow-up query:




      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics?




      The main point of inserting some extra vertical space between rows, via the addlinespace instructions, was to change the aesthetics, by creating a bit of "breathing space" inside the table. How to retain these aethetics while saving some vertical space isn't going to be straightforward. I suppose that executing setlength{defaultaddspace}{0.3em} immediately before $begin{array}..., and changing the two instances of \[0.5ex] to \0.3ex, should manage the preserve at least some of the aesthetics. Plus, you'll save about two rows of vertical space... The following screenshot juxtaposes the solution shown above with the one that results from reducing the value of defaultaddspace by 40%. (In case you're curious: eliminating the addlinespace directives entirely -- which would definitely affect the aesthetics in a major way! -- would save another 1 to 2 rows.)



      enter image description here






      share|improve this answer


























      • it was very difficult to choose one out of all the answers. i picked this one.

        – user_1_1_1
        Mar 13 at 15:19











      • Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

        – user_1_1_1
        Mar 13 at 15:53






      • 1





        @user_1_1_1 - Please see the addendum I just posted.

        – Mico
        Mar 13 at 19:21











      • Thanks. Could you take a stab at this one too?

        – user_1_1_1
        Mar 14 at 0:25














      1












      1








      1







      I would (a) employ an array environment instead of a tabular environment for the main table, (b) I wouldn't use the 'inner' tabular environments at all, (c) I'd use the line-drawing macros of the booktabs package for fewer, but well-spaced, horizontal lines, and (d) omit all vertical lines; they're not needed -- really!



      enter image description here



      documentclass{article}
      usepackage{booktabs} % toprule, midrule, bottomrule, addlinespace
      begin{document}

      begin{table}
      footnotesize
      centering
      $begin{array}{@{}ll@{}}
      toprule
      mbox{S.,No.} & mbox{Analysis} \
      midrule
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \
      bottomrule
      end{array}$
      caption{Example of a table}
      label{sth}
      end{table}

      end{document}




      Addendum to address the OP's follow-up query:




      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics?




      The main point of inserting some extra vertical space between rows, via the addlinespace instructions, was to change the aesthetics, by creating a bit of "breathing space" inside the table. How to retain these aethetics while saving some vertical space isn't going to be straightforward. I suppose that executing setlength{defaultaddspace}{0.3em} immediately before $begin{array}..., and changing the two instances of \[0.5ex] to \0.3ex, should manage the preserve at least some of the aesthetics. Plus, you'll save about two rows of vertical space... The following screenshot juxtaposes the solution shown above with the one that results from reducing the value of defaultaddspace by 40%. (In case you're curious: eliminating the addlinespace directives entirely -- which would definitely affect the aesthetics in a major way! -- would save another 1 to 2 rows.)



      enter image description here






      share|improve this answer















      I would (a) employ an array environment instead of a tabular environment for the main table, (b) I wouldn't use the 'inner' tabular environments at all, (c) I'd use the line-drawing macros of the booktabs package for fewer, but well-spaced, horizontal lines, and (d) omit all vertical lines; they're not needed -- really!



      enter image description here



      documentclass{article}
      usepackage{booktabs} % toprule, midrule, bottomrule, addlinespace
      begin{document}

      begin{table}
      footnotesize
      centering
      $begin{array}{@{}ll@{}}
      toprule
      mbox{S.,No.} & mbox{Analysis} \
      midrule
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},\[0.5ex]
      &x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ addlinespace
      3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \
      bottomrule
      end{array}$
      caption{Example of a table}
      label{sth}
      end{table}

      end{document}




      Addendum to address the OP's follow-up query:




      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics?




      The main point of inserting some extra vertical space between rows, via the addlinespace instructions, was to change the aesthetics, by creating a bit of "breathing space" inside the table. How to retain these aethetics while saving some vertical space isn't going to be straightforward. I suppose that executing setlength{defaultaddspace}{0.3em} immediately before $begin{array}..., and changing the two instances of \[0.5ex] to \0.3ex, should manage the preserve at least some of the aesthetics. Plus, you'll save about two rows of vertical space... The following screenshot juxtaposes the solution shown above with the one that results from reducing the value of defaultaddspace by 40%. (In case you're curious: eliminating the addlinespace directives entirely -- which would definitely affect the aesthetics in a major way! -- would save another 1 to 2 rows.)



      enter image description here







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 13 at 19:21

























      answered Mar 12 at 22:11









      MicoMico

      284k31388776




      284k31388776













      • it was very difficult to choose one out of all the answers. i picked this one.

        – user_1_1_1
        Mar 13 at 15:19











      • Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

        – user_1_1_1
        Mar 13 at 15:53






      • 1





        @user_1_1_1 - Please see the addendum I just posted.

        – Mico
        Mar 13 at 19:21











      • Thanks. Could you take a stab at this one too?

        – user_1_1_1
        Mar 14 at 0:25



















      • it was very difficult to choose one out of all the answers. i picked this one.

        – user_1_1_1
        Mar 13 at 15:19











      • Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

        – user_1_1_1
        Mar 13 at 15:53






      • 1





        @user_1_1_1 - Please see the addendum I just posted.

        – Mico
        Mar 13 at 19:21











      • Thanks. Could you take a stab at this one too?

        – user_1_1_1
        Mar 14 at 0:25

















      it was very difficult to choose one out of all the answers. i picked this one.

      – user_1_1_1
      Mar 13 at 15:19





      it was very difficult to choose one out of all the answers. i picked this one.

      – user_1_1_1
      Mar 13 at 15:19













      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

      – user_1_1_1
      Mar 13 at 15:53





      Is there a way to compress things a little bit more so that this takes the same space as the original one while retaining the aesthetics? I am short on space for my paper.

      – user_1_1_1
      Mar 13 at 15:53




      1




      1





      @user_1_1_1 - Please see the addendum I just posted.

      – Mico
      Mar 13 at 19:21





      @user_1_1_1 - Please see the addendum I just posted.

      – Mico
      Mar 13 at 19:21













      Thanks. Could you take a stab at this one too?

      – user_1_1_1
      Mar 14 at 0:25





      Thanks. Could you take a stab at this one too?

      – user_1_1_1
      Mar 14 at 0:25











      2














      With the help of the booktabs and the cellspace package you can achieve the following output:



      enter image description here



      documentclass{article}
      usepackage[utf8]{inputenc}
      usepackage{booktabs}
      usepackage{mathtools}
      usepackage{makecell}
      usepackage{cellspace}
      setlength{cellspacetoplimit}{6pt}
      setlength{cellspacebottomlimit}{6pt}
      begin{document}

      begin{table}
      footnotesize
      centering
      begin{tabular}{SlSc}
      toprule
      S. No. & Analysis \
      midrule
      $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
      $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
      $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
      bottomrule
      end{tabular}
      caption{Example of a table}
      label{sth}
      end{table}

      end{document}





      share|improve this answer




























        2














        With the help of the booktabs and the cellspace package you can achieve the following output:



        enter image description here



        documentclass{article}
        usepackage[utf8]{inputenc}
        usepackage{booktabs}
        usepackage{mathtools}
        usepackage{makecell}
        usepackage{cellspace}
        setlength{cellspacetoplimit}{6pt}
        setlength{cellspacebottomlimit}{6pt}
        begin{document}

        begin{table}
        footnotesize
        centering
        begin{tabular}{SlSc}
        toprule
        S. No. & Analysis \
        midrule
        $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
        $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
        $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
        bottomrule
        end{tabular}
        caption{Example of a table}
        label{sth}
        end{table}

        end{document}





        share|improve this answer


























          2












          2








          2







          With the help of the booktabs and the cellspace package you can achieve the following output:



          enter image description here



          documentclass{article}
          usepackage[utf8]{inputenc}
          usepackage{booktabs}
          usepackage{mathtools}
          usepackage{makecell}
          usepackage{cellspace}
          setlength{cellspacetoplimit}{6pt}
          setlength{cellspacebottomlimit}{6pt}
          begin{document}

          begin{table}
          footnotesize
          centering
          begin{tabular}{SlSc}
          toprule
          S. No. & Analysis \
          midrule
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
          $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
          $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          bottomrule
          end{tabular}
          caption{Example of a table}
          label{sth}
          end{table}

          end{document}





          share|improve this answer













          With the help of the booktabs and the cellspace package you can achieve the following output:



          enter image description here



          documentclass{article}
          usepackage[utf8]{inputenc}
          usepackage{booktabs}
          usepackage{mathtools}
          usepackage{makecell}
          usepackage{cellspace}
          setlength{cellspacetoplimit}{6pt}
          setlength{cellspacebottomlimit}{6pt}
          begin{document}

          begin{table}
          footnotesize
          centering
          begin{tabular}{SlSc}
          toprule
          S. No. & Analysis \
          midrule
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $1$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $2$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
          $3$ & begin{tabular}[c]{@{}c@{}}$x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt},$\[3pt] $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$end{tabular} \
          $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          $3$ & $x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}$ \
          bottomrule
          end{tabular}
          caption{Example of a table}
          label{sth}
          end{table}

          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 12 at 21:40









          leandriisleandriis

          10.4k1531




          10.4k1531























              2














              Is it better with the help of cellspace and makecell?



              documentclass{article}
              usepackage[utf8]{inputenc}

              usepackage{mathtools}
              usepackage{tabularx}
              usepackage[math]{cellspace}
              setlength{cellspacetoplimit}{3pt}
              setlength{cellspacebottomlimit}{3pt}

              usepackage{makecell}

              begin{document}

              begin{table}[!htb]
              footnotesize
              centering
              begin{tabular}{|l| >{$}Sc<{$}|}
              hline
              S. No. & text{Analysis} \ hline
              1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
              3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
              3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
              end{tabular}
              caption{Example of a table}
              label{sth}
              end{table}

              end{document}


              enter image description here






              share|improve this answer




























                2














                Is it better with the help of cellspace and makecell?



                documentclass{article}
                usepackage[utf8]{inputenc}

                usepackage{mathtools}
                usepackage{tabularx}
                usepackage[math]{cellspace}
                setlength{cellspacetoplimit}{3pt}
                setlength{cellspacebottomlimit}{3pt}

                usepackage{makecell}

                begin{document}

                begin{table}[!htb]
                footnotesize
                centering
                begin{tabular}{|l| >{$}Sc<{$}|}
                hline
                S. No. & text{Analysis} \ hline
                1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                end{tabular}
                caption{Example of a table}
                label{sth}
                end{table}

                end{document}


                enter image description here






                share|improve this answer


























                  2












                  2








                  2







                  Is it better with the help of cellspace and makecell?



                  documentclass{article}
                  usepackage[utf8]{inputenc}

                  usepackage{mathtools}
                  usepackage{tabularx}
                  usepackage[math]{cellspace}
                  setlength{cellspacetoplimit}{3pt}
                  setlength{cellspacebottomlimit}{3pt}

                  usepackage{makecell}

                  begin{document}

                  begin{table}[!htb]
                  footnotesize
                  centering
                  begin{tabular}{|l| >{$}Sc<{$}|}
                  hline
                  S. No. & text{Analysis} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                  3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                  3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  end{tabular}
                  caption{Example of a table}
                  label{sth}
                  end{table}

                  end{document}


                  enter image description here






                  share|improve this answer













                  Is it better with the help of cellspace and makecell?



                  documentclass{article}
                  usepackage[utf8]{inputenc}

                  usepackage{mathtools}
                  usepackage{tabularx}
                  usepackage[math]{cellspace}
                  setlength{cellspacetoplimit}{3pt}
                  setlength{cellspacebottomlimit}{3pt}

                  usepackage{makecell}

                  begin{document}

                  begin{table}[!htb]
                  footnotesize
                  centering
                  begin{tabular}{|l| >{$}Sc<{$}|}
                  hline
                  S. No. & text{Analysis} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  1 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  2 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                  3 & makecell{x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}, \[0.5ex] x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}} \ hline
                  3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  3 & x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt}+x^c_{pq}+p^{34r}_{rt} \ hline
                  end{tabular}
                  caption{Example of a table}
                  label{sth}
                  end{table}

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 12 at 21:43









                  BernardBernard

                  173k776205




                  173k776205






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479175%2flack-of-spacing-in-table-due-to-text-blurring-into-the-borders%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                      ComboBox Display Member on multiple fields

                      Is it possible to collect Nectar points via Trainline?