0

I need to build a table in overleaf, most of the content of the cells have a lot of content that in excel would be wrapped to make them fit. I have tried all the online table editors and also tried to create my own tables but none of them work. They are all too wide or if I can get them to fit on the page then they are too small to read. I have looked at all the answers to similar questions but fail to find the right fix. AT this stage after 2 whole days wasted on trying to fix a simple table I have no more time and was wondering if there is any paid table generator software or online tool that I can get that has more advanced features such as wrapped text?

this is the latest table that I have been working with.

\begin{table}[ht]
\centering
\begin{tabular}{ll}
\hline
\textbf{Fungible Tokens} & \textbf{Non-fungible tokens} \\ \hline
{\color[HTML]{333333} \begin{tabular}[c]{@{}l@{}}Interchangeable Here a token can be exchanged for another token if its of the same type. For example, 100 Bitcoin can be exchanged for 100 Bitcoin\end{tabular}} & \begin{tabular}[c]{@{}l@{}}Not-Interchangeable Here a non-fungible token cannot be exchanged or replaced with another non-fungible token. For example, a non-fungible token representing an unique asset such as a property cannot be exchanged with another unique property asset.\end{tabular} \\ \hline
\begin{tabular}[c]{@{}l@{}}Uniform Each token is of the same type, is identical in their specification. For example, Bitcoin is a fungible token and each bitcoin is of the same type and identical to any other bitcoin on the network\end{tabular} & \begin{tabular}[c]{@{}l@{}}Unique Each token is unique and has different characteristics to the next token. For example, a unique asset represented as a digital asset such as a property will be unique to all other properties. Each property will be uniquely represented.\end{tabular} \\ \hline
\begin{tabular}[c]{@{}l@{}}Divisible Fungible tokens can be divided into smaller amounts. For example, 100 Bitcoin can be divided into two units 50 Bitcoin or 100 units of 1 Bitcoin. There is no change in the value of the 100 bitcoin even if its broken down into smaller units.\end{tabular} & \begin{tabular}[c]{@{}l@{}}Non-divisable Non-fungible tokens cannot be broken down into smaller units. For example, a whole property represented as a digital asset cannot be broken down into units.\end{tabular} \\ \hline
\end{tabular}
\end{table}

I am working with a provided template but I think the below is what you are asking for. TX

% Set up the document
\documentclass[a4paper, 11pt, oneside]{Thesis}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

\graphicspath{Figures/}

% Include any extra LaTeX packages required
\usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style for the references in the Bibliography

\usepackage[nottoc]{tocbibind} % bind bibliography to the table of contents
\usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\usepackage[table]{xcolor}
% \usepackage{booktabs}
% \usepackage{graphicx}
% \usepackage[table,xcdraw]{xcolor}
% \usepackage{csvsimple}
\usepackage{array}
\usepackage{tabularx}
\usepackage[table,xcdraw]
\usepackage{graphicx}

\hypersetup{urlcolor=black, colorlinks=true}  % Colours hyperlinks in black, can be distracting if there are many links and colored blue.

%% ----------------------------------------------------------------
\begin{document}
\frontmatter      % Begin Roman style (i, ii, iii, iv...) page numbering
10
  • 1
    p{<width>} (as in p{2cm}) columns wrap automatically at the given width, but then the text is justified, which may lead to undesirably large space. You can define ragged left/right fixed-width columns with tex.stackexchange.com/q/12703/35864. Maybe that already helps. But if your tables are still too large have you thought about splitting them up into several smaller tables? (I would not rely on table generators too much, the code they produce can be .. interesting.)
    – moewe
    Apr 5, 2020 at 9:45
  • 2
    From my experience, almost all automacially generated code for tables needs at least some manual adjustments in order to get a decent result. My table doesn't fit; what are my options? contains some ideas on how you can make a table fit into a given page.
    – leandriis
    Apr 5, 2020 at 9:47
  • 1
    Depending on the actual contents of the table, using p type columns, as also suggested by moewe might be worth a try. If you have a few columns with lengthier text, you could give tabularx a try. If your table contains a lot of columns, manually reducing the font size to small and adjusting the value of \tabcolsep might also already be sufficient. A lot also depends on how much too wide your table is. If you have many columns with text in them, rotating the table to a landscape oriented page could also be an option.
    – leandriis
    Apr 5, 2020 at 9:48
  • 1
    you don't give any clue as to what is in your table. most excel based tables are numeric so getting things to fit is a matter of choosing an appropriate font size and inter-column spacing. line wrapping is not normally involved except possibly in the headings. Or does your table have paragraphs of text? The techniques are completely different for tables of text (and p columns with line breaking are far more important). Apr 5, 2020 at 9:54
  • 1
    If you are willing to share more information about your table, ideally in the form of a minimal working example (MWE) that shows what you tried so far, you can get more specific advice on how you can make that table fit into the text width.
    – leandriis
    Apr 5, 2020 at 9:58

1 Answer 1

2

Here are three quick examples. I have used tabularx and two X type columns to make the table as wide as the text width and to allow for automatic linebreaks insode of the table cells. In the second and third ecample, I have also replaced the \hline commands with the horizontal lines from the booktabs package and removed some of the lines altogether. In the second and third example, I have also used \emph (and linebreaks in the third example) in order to add a subtle visual highlight to the keywords in the beginning of each cell's text.

Note: In the original example, the cell in the first column/first row has a differently colored text. I have left it as is in the first example, but removed the color in example 2 and 3 as I was unsure if the color change was intentional. In the MWE, I have also used the article class instead of Thesis since there are many classes around called thesis.cls and I did not konw which one exactly you were using.

enter image description here

\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{booktabs}
\begin{document}

\begin{table}[ht]
\centering
\begin{tabularx}{\textwidth}{XX}
\hline
\textbf{Fungible Tokens} & \textbf{Non-fungible tokens} \\ \hline
{\color[HTML]{333333} Interchangeable Here a token can be exchanged for another token if its of the same type. For example, 100 Bitcoin can be exchanged for 100 Bitcoin} & Not-Interchangeable Here a non-fungible token cannot be exchanged or replaced with another non-fungible token. For example, a non-fungible token representing an unique asset such as a property cannot be exchanged with another unique property asset. \\ \hline
Uniform Each token is of the same type, is identical in their specification. For example, Bitcoin is a fungible token and each bitcoin is of the same type and identical to any other bitcoin on the network & Unique Each token is unique and has different characteristics to the next token. For example, a unique asset represented as a digital asset such as a property will be unique to all other properties. Each property will be uniquely represented. \\ \hline
Divisible Fungible tokens can be divided into smaller amounts. For example, 100 Bitcoin can be divided into two units 50 Bitcoin or 100 units of 1 Bitcoin. There is no change in the value of the 100 bitcoin even if its broken down into smaller units. & Non-divisable Non-fungible tokens cannot be broken down into smaller units. For example, a whole property represented as a digital asset cannot be broken down into units. \\ \hline
\end{tabularx}
\end{table}

\begin{table}[ht]
\centering
\begin{tabularx}{\textwidth}{XX}
\toprule
Fungible Tokens & Non-fungible tokens \\
\midrule
\emph{Interchangeable} Here a token can be exchanged for another token if its of the same type. For example, 100 Bitcoin can be exchanged for 100 Bitcoin 
    &\emph{Not-Interchangeable} Here a non-fungible token cannot be exchanged or replaced with another non-fungible token. For example, a non-fungible token representing an unique asset such as a property cannot be exchanged with another unique property asset. \\ 
\addlinespace
\emph{Uniform} Each token is of the same type, is identical in their specification. For example, Bitcoin is a fungible token and each bitcoin is of the same type and identical to any other bitcoin on the network 
    & \emph{Unique} Each token is unique and has different characteristics to the next token. For example, a unique asset represented as a digital asset such as a property will be unique to all other properties. Each property will be uniquely represented. \\ 
\addlinespace
\emph{Divisible} Fungible tokens can be divided into smaller amounts. For example, 100 Bitcoin can be divided into two units 50 Bitcoin or 100 units of 1 Bitcoin. There is no change in the value of the 100 bitcoin even if its broken down into smaller units. 
    & \emph{Non-divisable} Non-fungible tokens cannot be broken down into smaller units. For example, a whole property represented as a digital asset cannot be broken down into units. \\ 
\bottomrule
\end{tabularx}
\end{table}

\begin{table}[ht]
\centering
\begin{tabularx}{\textwidth}{XX}
\toprule
\multicolumn{1}{l}{Fungible Tokens} & \multicolumn{1}{l}{Non-fungible tokens} \\
\midrule
\multicolumn{1}{l}{\emph{Interchangeable}} & \multicolumn{1}{l}{\emph{Not-Interchangeable}}\\
 Here a token can be exchanged for another token if its of the same type. For example, 100 Bitcoin can be exchanged for 100 Bitcoin 
    & Here a non-fungible token cannot be exchanged or replaced with another non-fungible token. For example, a non-fungible token representing an unique asset such as a property cannot be exchanged with another unique property asset. \\ 
\addlinespace
\multicolumn{1}{l}{\emph{Uniform}} & \multicolumn{1}{l}{\emph{Unique}}\\
 Each token is of the same type, is identical in their specification. For example, Bitcoin is a fungible token and each bitcoin is of the same type and identical to any other bitcoin on the network 
    &  Each token is unique and has different characteristics to the next token. For example, a unique asset represented as a digital asset such as a property will be unique to all other properties. Each property will be uniquely represented. \\ 
\addlinespace
\multicolumn{1}{l}{\emph{Divisible}} & \multicolumn{1}{l}{\emph{Non-divisable}}\\
 Fungible tokens can be divided into smaller amounts. For example, 100 Bitcoin can be divided into two units 50 Bitcoin or 100 units of 1 Bitcoin. There is no change in the value of the 100 bitcoin even if its broken down into smaller units. 
    &  Non-fungible tokens cannot be broken down into smaller units. For example, a whole property represented as a digital asset cannot be broken down into units. \\ 
\bottomrule
\end{tabularx}
\end{table}
\end{document}
7
  • I have tired what you provided above and it works yyyaaaaaaaaaaaaaaaa. 2 days of working on this so many many thanks for your help. It now fits on the page correctly. I will review what you have done so I will be able to do it again. Apr 5, 2020 at 10:26
  • @MaryODonovan: You're welcome. I have added a little bit of explanation to my answer. I hope this helps.
    – leandriis
    Apr 5, 2020 at 10:31
  • It sure does, thanks so much for the explanations as this really helps. Was driving me mad spending so much time on a table and no time on my actual thesis :-) I have voted for the answer so hope I done it right. Thanks again Apr 5, 2020 at 10:33
  • 1
    @MaryODonovan this answer has no votes (except it will show 1 after I vote in a second) and no tick, so whatever you did you neither voted for it nor accepted it. That's OK you don't have to vote but since you said you had done, I thought I'd comment. Apr 5, 2020 at 12:07
  • while this solved the OP's problem, it did not answer his question.
    – crobar
    May 8, 2020 at 13:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .