0

I structured a table as well, but the second one do not appears. This is the output: https://imgur.com/a/N1I8Ue3 This is the table:

\begin{tabular}{p{6cm}p{6cm}}
    \begin{tabular}{ll}
    \toprule
    \textbf{{Cognitive-intellectual field}} \\
    \midrule
    Thinking fluidly & Generating large amounts of ideas \\
    Thinking more... & Fast flow of thought \\
    & Number of relevant answers & \\
    \\
    Flexible thinking & Variety of types of ideas \\
    Take different approaches & Ability to move from one category to another \\
    & Change direction of thought by bypassing obstacles \\
    \\
    Original thought & Unusual answers \\
    Think in new or unique ways & Smart ideas \\
    & Mental production that deviates from the obvious \\
    \\
    Elaborative thinking & Embellish an idea or a simple answer to make it more elegant \\
    Add to... & Extend or expand reasoning or ideas
    \end{tabular}
    \\[10em]
    \begin{tabular}{lll}
    \toprule
    \textbf{Emotional setting (personality)} \\
    \midrule
    Availability to take risks & Expose to failure or criticism \\
    Have the courage to... & Try to guess \\
    & Work well even in unstructured conditions \\
    & Defend your ideas \\
    \\
    Complexity & Look for numerous alternatives \\
    Feeling challenged... & See the gap between how things are and how they should be \\
    & Restore order starting from chaos \\
    & Move into intricate ideas or problems \\
    \\
    Curiosity & Be inquisitive and fantasize \\
    Wanting to... & Play with an idea \\
    & Be open to bewildering situations \\
    & Meditate on the mystery of things \\
    \\
    Imagination & Visualize and build mental images \\
    To have the power of... & Dreaming of things that never happened \\
    & Feel intuitively \\
    & Go beyond sensory limits or real characteristics \\
    \noalign
    \end{tabular}
    \\[5em]
    % Colour for the rulings in tables:
    \makeatletter
       \def\rulecolor#1#{\CT@arc{#1}}
       \def\CT@arc#1#2{%
       \ifdim\baselineskip=\z@\noalign\fi
       {\gdef\CT@arc@{\color#1{#2}}}}
       \let\CT@arc@\relax
      \rulecolor{gray!50}
    \makeatother
\end{tabular}
4
  • Welcome to TeX:SE! Please extend your code fragment to compilable small document. Given links can become dead after while ... Why you nested table in table? You define much more columns as you then use them. – Zarko Sep 8 '19 at 7:23
  • When you compile the document in Overleaf, you should get a number in a red box above the preview. That the box is red indicates that there are errors, and you can't expect the correct output when there are errors. So never ignore errors. As Zarko mentioned, you get one error from the line with "number of relevant answers" because you have two & in a table with just two columns, and you get a second one from the \noalign at the end. – Torbjørn T. Sep 8 '19 at 7:30
  • I'm only getting two warning at \begin{tabluar}{ll} which say "Overfull \hbox (332.08882 too wide) in paragraph " – Fabio Sep 8 '19 at 7:47
  • 1
    That warning means the text is several centimetres off the edge of the paper.... – David Carlisle Sep 8 '19 at 8:29
2

Probably you are more satisfied with the following:

enter image description here

I have used a single tabularx environment for both parts of the table. This ensures that the table is only as wide as the current textwidth (or any other width that you specify). I have also used \multicolumn{2}{l}{...} for the "headers". This makes sure that the left column is just as wide as the contents and does not take into account the width of the header text. You will therefore have less unused white space between the columns. I have also replaced the empty rows with the \addlinespace command from the booktabs package. The vertical white space is a bit smaller than an empty row, but still provides enough visual separation between rows. Lastly, I have also added a more simple variant of coloring the lines in the table. Uncommen the three lines in the below code and the table will have gray instead of black lines.

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
%% \usepackage[table]{xcolor} % uncomment for light gray lines in table
\begin{document}

%%{\arrayrulecolor{gray!50} % uncomment for light gray lines in table
\noindent
    \begin{tabularx}{\textwidth}{lX}
    \toprule
    \multicolumn{2}{l}{\textbf{{Cognitive-intellectual field}}} \\
    \midrule
    Thinking fluidly & Generating large amounts of ideas \\
    Thinking more... & Fast flow of thought \\
    & Number of relevant answers  \\
    \addlinespace
    Flexible thinking & Variety of types of ideas \\
    Take different approaches & Ability to move from one category to another \\
    & Change direction of thought by bypassing obstacles \\
    \addlinespace
    Original thought & Unusual answers \\
    Think in new or unique ways & Smart ideas \\
    & Mental production that deviates from the obvious \\
    \addlinespace
    Elaborative thinking & Embellish an idea or a simple answer to make it more elegant \\
    Add to... & Extend or expand reasoning or ideas\\
    \\
    \midrule
    \multicolumn{2}{l}{\textbf{Emotional setting (personality)}} \\
    \midrule
    Availability to take risks & Expose to failure or criticism \\
    Have the courage to... & Try to guess \\
    & Work well even in unstructured conditions \\
    & Defend your ideas \\
    \addlinespace
    Complexity & Look for numerous alternatives \\
    Feeling challenged... & See the gap between how things are and how they should be \\
    & Restore order starting from chaos \\
    & Move into intricate ideas or problems \\
    \addlinespace
    Curiosity & Be inquisitive and fantasize \\
    Wanting to... & Play with an idea \\
    & Be open to bewildering situations \\
    & Meditate on the mystery of things \\
    \addlinespace
    Imagination & Visualize and build mental images \\
    To have the power of... & Dreaming of things that never happened \\
    & Feel intuitively \\
    & Go beyond sensory limits or real characteristics \\
   \bottomrule
    \end{tabularx}
%%} % uncomment for light gray lines in table
\end{document}
2

If you really want different first column widths in the two sub-tables ...

Here is your table as an MWE, but it is very difficult to understand what you want to achieve. As you will see, the two nested tabulars go into the first column of the main tabular, and in the second nested tabular, you define three columns, but use two.

The sub-tabulars is wider than the documents margins. This can be fixed by decreasing the margins, just add

\usepackage[left=2.5cm, right=2.5cm]{geometry} 

to the preamble of the MWE. The defined command in the last cell seems be an attempt to have gray rules. Instead, use

\arrayrulecolor{gray!50}

To avoid overfull hboxes and complicated column calculation, I converted the main table to a tabularx-table and made the second column as an X-column.

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage[table]{xcolor}
 \arrayrulecolor{gray!50}
 \usepackage[left=2.5cm, right=2.5cm]{geometry}
 \usepackage{tabularx}


\begin{document}

\noindent\begin{tabularx}{\linewidth}{@{}lX@{}}
    \begin{tabular}{ll}
    \toprule
    \textbf{{Cognitive-intellectual field}} \\
    \midrule
    Thinking fluidly & Generating large amounts of ideas \\
    Thinking more... & Fast flow of thought \\
    & Number of relevant answers  \\
    \\
    Flexible thinking & Variety of types of ideas \\
    Take different approaches & Ability to move from one category to another \\
    & Change direction of thought by bypassing obstacles \\
    \\
    Original thought & Unusual answers \\
    Think in new or unique ways & Smart ideas \\
    & Mental production that deviates from the obvious \\
    \\
    Elaborative thinking & Embellish an idea or a simple answer to make it more elegant \\
    Add to... & Extend or expand reasoning or ideas
    \end{tabular}
    \\[10em]
    \begin{tabular}{lll}
    \toprule
    \textbf{Emotional setting (personality)} \\
    \midrule
    Availability to take risks & Expose to failure or criticism \\
    Have the courage to... & Try to guess \\
    & Work well even in unstructured conditions \\
    & Defend your ideas \\
    \\
    Complexity & Look for numerous alternatives \\
    Feeling challenged... & See the gap between how things are and how they should be \\
    & Restore order starting from chaos \\
    & Move into intricate ideas or problems \\
    \\
    Curiosity & Be inquisitive and fantasize \\
    Wanting to... & Play with an idea \\
    & Be open to bewildering situations \\
    & Meditate on the mystery of things \\
    \\
    Imagination & Visualize and build mental images \\
    To have the power of... & Dreaming of things that never happened \\
    & Feel intuitively \\
    & Go beyond sensory limits or real characteristics \\
 %   \noalign
    \end{tabular}
    \\[5em]
%    % Colour for the rulings in tables:
%    \makeatletter
%       \def\rulecolor#1#{\CT@arc{#1}}
%       \def\CT@arc#1#2{%
%       \ifdim\baselineskip=\z@\noalign\fi
%       {\gdef\CT@arc@{\color#1{#2}}}}
%       \let\CT@arc@\relax
%      \rulecolor{gray!50}
%    \makeatother
\end{tabularx}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.