0

I want add a list inside a table. My actual code is the following

\documentclass[12pt,a4paper,twoside,openright]{book}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}{>{\centering\arraybackslash}m{4cm}}

\begin{document}

\begin{table}[t]
    \centering
    \begin{tabular}{LLL}
        \multicolumn{3}{c}{\textbf{Neuromarketing Tools}}\\
        \midrule
        Metabolic Brain's Activities & Electrical Brain's Activities & Without Brain's Activities\\
        \midrule        
        Position Emission Tomography (PET) & Electroencephalography (EEG) & Eye tracking\\
        Functional Magnetic Resonance Imaging (FMRI) & Magnetoencephalography (MEG) & Skin conductance\\
        & Steady State Topography (SST) & Facial coding\\
        & Transcranial Magnetic Stimulation (TMS) & Facial electromyography\\
        \bottomrule
    \end{tabular}
    \caption{Classification of neuromarketing tools.}
    \label{tab:neuro_tools}
\end{table}

\end{document}

an the result is

enter image description here

But that is not what I want. I need the items are listed (with dots) and not disposed in the same rows. I hope my question is clear.

Any suggestion?

EDIT: I've tried to add \itemize

\documentclass[12pt,a4paper,twoside,openright]{book}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}{>{\centering\arraybackslash}m{4cm}}

\begin{document}

\begin{table}[t]
    \centering
    \begin{tabular}{LLL}
        \multicolumn{3}{c}{\textbf{Neuromarketing Tools}}\\
        \midrule
        Metabolic Brain's Activities & Electrical Brain's Activities & Without Brain's Activities\\
        \midrule
        \begin{itemize}
            \item Position Emission Tomography (PET)
            \item Functional Magnetic Resonance Imaging (FMRI)
        \end{itemize}
        & \begin{itemize}
            \item Electroencephalography (EEG)
            \item Magnetoencephalography (MEG)
            \item Steady State Topography (SST)
            \item Transcranial Magnetic Stimulation (TMS)
        \end{itemize}
        & \begin{itemize}
            \item Eye tracking
            \item Skin conductance
            \item Facial coding
            \item Facial electromyography
        \end{itemize}\\
        \bottomrule
    \end{tabular}
    \caption{Classification of neuromarketing tools.}
    \label{tab:neuro_tools2}
\end{table}

\end{document}

it's close to the solution but there are again some issue:

enter image description here

thoraz
  • 113
  • 4
  • just use \begin{itemize}\item...\item .\end{itemize} to put a list in a cell of teh table – David Carlisle Oct 16 '18 at 08:31
  • Hi, In which column(s) are the items you would line to have as a list? The solution is to use a \multirow command in this column and add them inside a minipage, inside itemize (the minipage possibly needed just with it's optional parameter to align vertical with tho other cells) – koleygr Oct 16 '18 at 08:32
  • possibly:-) post an answer anyway:-) (I deleted initial comment) – David Carlisle Oct 16 '18 at 08:35
  • @DavidCarlisle Deleted mine too... but I have to wait for the op to answer about the column he want the list... Possibly will be away when he will answer... So, everyone is welcome to answer (using his own method or mine) – koleygr Oct 16 '18 at 08:38
  • @koleygr I want the lists in all 3 columns and after the second \midrule – thoraz Oct 16 '18 at 08:43
  • @thoraz.. fixed the width too – koleygr Oct 16 '18 at 09:44
  • @DavidCarlisle.. minipages was a stupid idea as seems in my answer – koleygr Oct 16 '18 at 09:50
  • @koleygr well p column is more or less same as a minipage but here you are only needing to use \multicolumn{1}{p} to replace the m column by p so it would be simpler to use p in the tabular preamble and then just add the list directly – David Carlisle Oct 16 '18 at 09:57
  • @DavidCarlisle, I used \multicolumn just to avoid the extra spaces with @{}. I have p in my answer... – koleygr Oct 16 '18 at 10:10

2 Answers2

0

Use Itemize to format the table content.

    \begin{table}[t]
    \centering
    \begin{tabular}{LLL}
        \multicolumn{3}{c}{\textbf{Neuromarketing Tools}}\\
        \midrule
        Metabolic Brain's Activities & Electrical Brain's Activities & Without Brain's Activities\\
        \midrule      
        \begin{itemize}
            \item Position Emission Tomography (PET)
            \item EEG
            \item Eye tracking
        \end{itemize}  


    \end{tabular}
    \caption{Classification of neuromarketing tools.}
    \label{tab:neuro_tools}
\end{table}

this

0

Edit: minipages don't really needed and the result is better without them. My idea about the (vertical) alignment inside the tabular was really stupid, and leaving the below (before edit) code as a bad example of minipage usege.

\documentclass[12pt,a4paper,twoside,openright]{book}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{multirow}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{table}[t]
    \centering
    \begin{tabular}{@{}L{0.3\textwidth}cL{0.22\textwidth}@{}}
        \multicolumn{3}{c}{\textbf{Neuromarketing Tools}}\\
        \midrule
        Metabolic Brain's Activities & Electrical Brain's Activities & Without Brain's Activities\\
        \midrule        
        \multicolumn{1}{@{}p{0.3\textwidth}@{}}{\begin{itemize}\item Position Emission Tomography (PET)\item Functional Magnetic Resonance Imaging (FMRI)\end{itemize}} &
        \multicolumn{1}{@{}p{0.42\textwidth}}{ \begin{itemize}\item Electroencephalography (EEG) \item Magnetoencephalography (MEG) \item Steady State Topography (SST) \item Transcranial Magnetic Stimulation (TMS) \end{itemize}} & 
        \multicolumn{1}{p{0.2\textwidth}@{}}{ \begin{itemize}\item  Eye tracking \item Skin conductance \item Facial coding \item Facial electromyography \end{itemize}}\\
        \bottomrule
    \end{tabular}
    \caption{Classification of neuromarketing tools.}
    \label{tab:neuro_tools}
\end{table}

\end{document}

Output: (with text width)

enter image description here

Old answer:

Here is an answer but get's over the text width because I don't want to break second column's words:

\documentclass[12pt,a4paper,twoside,openright]{book}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{multirow}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{table}[t]
    \centering
    \begin{tabular}{@{}L{0.34\textwidth}cL{0.22\textwidth}@{}}
        \multicolumn{3}{c}{\textbf{Neuromarketing Tools}}\\
        \midrule
        Metabolic Brain's Activities & Electrical Brain's Activities & Without Brain's Activities\\
        \midrule        
       \multicolumn{1}{@{}p{0.34\textwidth}@{}}{\begin{minipage}[inner sep=0,outer sep=0]{0.34\textwidth} \begin{itemize}\item Position Emission Tomography (PET)\item Functional Magnetic Resonance Imaging (FMRI)\end{itemize}\end{minipage}} &\multicolumn{1}{@{}p{0.42\textwidth}}{\begin{minipage}[ inner sep=0,outer sep=0]{0.42\textwidth} \begin{itemize}\item Electroencephalography (EEG) \item Magnetoencephalography (MEG) \item Steady State Topography (SST) \item Transcranial Magnetic Stimulation (TMS) \end{itemize}\end{minipage}} & \multicolumn{1}{p{0.2\textwidth}@{}}{\begin{minipage}[inner sep=0]{0.2\textwidth} \begin{itemize}\item  Eye tracking \item Skin conductance \item Facial coding \item Facial electromyography \end{itemize}\end{minipage}}\\
        \bottomrule
    \end{tabular}
    \caption{Classification of neuromarketing tools.}
    \label{tab:neuro_tools}
\end{table}

\end{document}

I used multicolumn instead of multirow, and I am not sure if minipages are really useful but I think needed.

koleygr
  • 20,105
  • Thanks a lot, but if I want the lists attached to the top of the columns? And consider that if the words in the second column is cut, it's ok for me. – thoraz Oct 16 '18 at 09:36
  • @thoraz... Edited... see edited better (top) solution. Fixed width too – koleygr Oct 16 '18 at 09:40
  • Very good, thanks. Last request: if I want to cut the words in the second column to reduce its width and so increase the third? – thoraz Oct 16 '18 at 09:55
  • @thoraz, just reduce the lengths in the column types on the tabular definition and on the multicolumn. A manually break that would be possibly better is here: https://tex.stackexchange.com/a/19678/120578 – koleygr Oct 16 '18 at 10:12