1

I generated this table using an Excel add-in. The table looks extremely small on the Latex file. What should I do to make it clearer and better looking?

\documentclass{article}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage{amssymb}
\usepackage{eufrak}
\usepackage{amsmath}
\usepackage{amsxtra}
\usepackage{graphicx}

\begin{document}

\begin{table}[] \caption{} \label{tab:my-table} \resizebox{1 \textwidth}{!}{ \begin{tabular}{ccccccccccccccc} \hline \multicolumn{1}{l}{} & \multicolumn{7}{c}{weqr} & \multicolumn{7}{c}{qwe} \ \hline \multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{qweifh} & \multicolumn{1}{c|}{sfhawd} & \multicolumn{1}{c|}{aefdaa} & \multicolumn{1}{c|}{wsedddwe} & \multicolumn{1}{c|}{ddadddd} & \multicolumn{1}{c|}{aedaedf} & \multicolumn{1}{c|}{dddddd} & \multicolumn{1}{c|}{dddddd} & \multicolumn{1}{c|}{ddddd} & \multicolumn{1}{c|}{ddddddd} & \multicolumn{1}{c|}{ddddd} & \multicolumn{1}{c|}{ddddd} & \multicolumn{1}{c|}{ddddd} & \multicolumn{1}{c|}{ddddddd} \ \hline \multicolumn{1}{|c|}{ddd} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{89} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{\textbf{}} & \multicolumn{4}{c|}{\textbf{rtyrtyrtytryrtyrt}} & \multicolumn{10}{c|}{\textbf{tyututryrytr}} \ \hline \multicolumn{1}{|c|}{\textbf{q}} & \multicolumn{1}{c|}{w} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{eee} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{e} & \multicolumn{1}{c|}{dddd} \ \hline \multicolumn{1}{|c|}{ddd} & \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{5} & \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{89} & \multicolumn{1}{c|}{0} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \multicolumn{1}{|c|}{ddd} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{\textbf{-}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{9} \ \hline \end{tabular} } \end{table}

\end{document}

moewe
  • 175,683
  • 1
    Please show a Minimal Working Example, as other things in your code could have an effect. Thing being said, using \resizebox on a table is always a Very Bad Idea and typically leads to this sort of problem... If the table is too big, it should be redesigned, not scaled down. At the very least, remove the \resizebox command. – Miyase Jun 07 '22 at 23:05
  • Thank you for the reply, The table is extremely big if resize is not used. Is there any other way to increase the height of the table but keep the width constant? – Iamnotperfect Jun 07 '22 at 23:09
  • SInce your code isn't compilable I can't check, but if the problem is only height, you couldn turn the table into a longtable that LaTeX can automaticallu split over several pages if necessary. – Miyase Jun 07 '22 at 23:14
  • I am sorry I am new to this, I didn't know that my code was not running. Please try to run it now. I think you can see where my exact problem is – Iamnotperfect Jun 07 '22 at 23:30
  • For a LaTeX code to compilable, it must at least have a \documentclass command, followed by a document environment. As it is, if I copy-paste your code, it won't compile without me adding several lines of code. And I have no way of knowing if they would match what you're using. – Miyase Jun 07 '22 at 23:31
  • Got it. Sorry about that. Please look at it now. I added document class and other packages that I am using. – Iamnotperfect Jun 07 '22 at 23:38
  • 1
    All those \multicolumn{1}...s are mess; this Excel add in is making your life harder. It would be better just to import the values without any of the formatting, and apply the formatting after import. I don't see how changing the height will help. You could get a little more room by decreasing the tabcolsep length, but the structure of the table needs rethinking. I'd break it up somehow but without knowing what the data means, it's hard to give concrete advice about the best way to do that. Maybe a separate table for "weqr" and for "qwe", one over the other? – frabjous Jun 08 '22 at 00:15
  • Excel tables have sliders and user can see only dynamically selected part of the table on the screen. But this feature isn't present when you want to print the table on the paper. The paper doesn't have the sliders. When you are using TeX then you want to print fixed tables on the paper (PDF emulates the fixed printing on the paper). So, you have to select only a subset of the Excel table to print it on the paper or use more parts in more tables. The automatic conversion using Excel add is not applicable. – wipet Jun 08 '22 at 04:35

1 Answers1

3

As the comments observed, your fundamental problem is that you've taken a very wide table and resized it. Resizing is (almost?) always a bad idea, for exactly this reason.

I would strongly recommend that you read up on creating tables in LaTeX. \multicolumn{1}{}{} is almost never necessary, and you could have achieved the same effect by specifying the vertical line in the argument to tabular. That would have left your actual source much easier to read.

It's hard to tell, because you put in junk instead of fake data, but based on the longer \multicolumn commands that you did use, it looks like you have four tables crammed into one. In that case, the obvious answer is to separate them out.

I'm a big fan of booktabs and its approach to tabular data. Guessing at how you would split those tables, you would end up with the following:

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\begin{table}\centering \caption{weqr} \label{tab:weqr} \begin{tabular}{cccccccc} \toprule & qweifh & sfhawd & aefdaa & wsedddwe & ddadddd & aedaedf & dddddd \\midrule ddd & 1 & 2 & 3 & 4 & 5 & 5 & 6 \ ddddd & - & - & - & - & - & - & - \ ddddd & - & - & - & - & - & - & - \ ddd & - & - & - & - & - & - & - \\bottomrule \end{tabular} \end{table}

\begin{table}\centering \caption{rtyrtyrtytryrtyrt}\label{tab:rtyrtyrtytryrtyrt} \begin{tabular}{ccccc}\toprule q & w & e & eee & e \\midrule ddd & 1 & 2 & 3 & 4 \ ddddd & - & - & - & - \ ddddd & - & - & - & - \ ddd & - & - & - & - \\bottomrule \end{tabular} \end{table}

\begin{table}\centering \caption{qwe}\label{tab:qwe} \begin{tabular}{cccccccc}\toprule & dddddd & ddddd & ddddddd & ddddd & ddddd & ddddd & ddddddd \ \midrule ddd & 7 & & 89 & 0 & - & 9 & 9 \ ddddd & - & - & - & - & - & 9 & 9 \ ddddd & - & - & - & - & - & 9 & 9 \ ddd & - & - & - & - & - & 9 & 9 \ \bottomrule \end{tabular} \end{table}

\begin{table}\centering \caption{tyututryrytr}\label{tab:tyututryrytr} \begin{tabular}{ccccccccccc}\toprule q & e & e & e & e & e & e & e & e & e & dddd \ \midrule ddd & 5 & 5 & 6 & 7 & & 89 & 0 & - & 9 & 9 \ ddddd & - & - & - & - & - & - & - & - & 9 & 9 \ ddddd & - & - & - & - & - & - & - & - & 9 & 9 \ ddd & - & - & - & - & - & - & - & - & 9 & 9 \ \bottomrule \end{tabular} \end{table}

\end{document}

code output

With four tables, you'll probably end up not liking TeX's placement of the tables. Take a look at https://tex.stackexchange.com/a/39019/107497 for how to deal with that.

Teepeemm
  • 6,708
  • Thank you for this post. But my requirement is to get all the tables in one big table. Also due to place constrain, I may need a little bigger? I feel somehow height is the problem? Is it possible to fit the entire table in one latex sheet keeping the width constant and by varying the height? – Iamnotperfect Jun 08 '22 at 06:22
  • The width is the problem. You have 15 columns that are as wide as wsedddwe. How would you have Excel print this out? How would you lay this out by hand? If you can't get the table into a reasonable width, you'll need to redesign it. We might be able to help with that, but not with the table data that you've shown us. – Teepeemm Jun 08 '22 at 13:11