TransWikia.com

Bullet points inside of a Tabular

TeX - LaTeX Asked by Waseem on July 7, 2021

I know some solutions are available to address this or similar problems. But I try my best and nothing comes out. I want to add the bullets points in Table cells. But instead of that I am getting all the points in horizontal line. Please check the image and latex script. I will be really thankful, if someone address this problem.

enter image description here

PS. :I am using overleaf

begin{table}[]
caption{Table}
label{tbl:artefact}
resizebox{textwidth}{!}{%
{renewcommand{arraystretch}{1}
begin{tabular}{lll}
hline
textbf{ID}                   & textbf{Some points}                                                                            & textbf{#}  hline
Info                 & begin{tabular}[c]{@{}l@{}}  
 begin{itemize}
     item 1
     item 2
     item 3
     item 4
     item 5
     item 6
 end{itemize}
end{tabular} & x1    hline
TEXT 2               &  SOME TEXT                                                                                     &   X2  hline
Text3                & Some text &  X3   hline
Text4                & Some text &  X4   hline
Text5                & Some text &  X5   hline                     Text6                & Some text &  X6   hline

Some values     &   begin{tabular}[c]{@{}l@{}}It is a table that shows XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX (textbf{P5}). end{tabular}      &   X7  hline
Intended XXX   & A description XXXXXXX (textbf{Px}).                                                        &  X8   hline
end{tabular}%
}quad
}
end{table}

One Answer

Lists shad to be in paragraph box column types as are p{<width>}, ... or X and its derivatives defined in tabularx package.

With use of the tabularx, enumitem and etoolbox packages:

enter image description here

documentclass{article}
usepackage[skip=1ex]{caption}
usepackage{booktabs, tabularx}
newcolumntype{L}{>{raggedrightarraybackslash}X}
usepackage{enumitem}
usepackage{etoolbox}
AtBeginEnvironment{table}{%
setlist[itemize]{nosep,
                 leftmargin=*,
                 label=textbullet,
                 before=begin{minipage}[t]{linewidth}, % <---
                 after=end{minipage}}                   % <---
                        }

begin{document}
    begin{table}[ht]
    caption{Table}
label{tbl:artefact}
begin{tabularx}{linewidth}{lXl}
    toprule
textbf{ID}                   
        & textbf{Some points}
            & textbf{#}            
    midrule
Info    &   begin{itemize}
         item 1
         item 2
         item 3
         item 4
         item 5
         item 6
            end{itemize}  
                    & x1         
    midrule
TEXT 2  &  SOME TEXT
                    &   X2         
Text3   & Some text &   X3         
Text4   & Some text &   X4         
Text5   & Some text &   X5                          
Text6   & Some text &   X6        
    midrule 
Some values     
        & It is a table that shows XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX (textbf{P5}).
                    &   X7       
    midrule
Intended XXX   
        & A description XXXXXXX (textbf{Px}).                                                       
                    &  X8   
    bottomrule
end{tabularx}%
    end{table}
end{document}

Correct answer by Zarko on July 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP