1

quite new to this. Hope you can help, trying to align bullets in a table but cannot get rid of the huge space at the beginning of the cell.

\documentclass[10pt]{article}
\usepackage{enumitem}
\begin{document}
\begin{table}[h]
    \renewcommand{\arraystretch}{1.5}
    \begin{tabular}{|p{4.5cm}|p{11.2cm}|}
    \hline
    \textbf{Role} & \textbf{Responsibilities} \\ \hline
    Insert Role &   
        \begin{description}[font=$\bullet$~\normalfont]
        \item Insert responsibility
        \end{description}        \\ \hline
    Insert Role & Aufzählung \\ \hline
    Insert Role & Aufzählung \\ \hline
    Insert Role & Aufzählung \\ \hline
    \end{tabular}
\end{table}
\end{document}

Image

Tried \textbullet but this does not leave space between the bullet an the text, but the vertical alignment is then working.

Would like to align the bullets with the first column.

Edit

The code was given, waiting for a small edit to make visible.

Added the \documentclass{article}, \usepackage{enumitem} and \begin{document} ... \end{document} to make compilable.

Partha D.
  • 2,250
  • 1
    Welcome to TeX SX! Could you please post a compilable code? – Bernard May 12 '21 at 13:59
  • 2
    https://tex.stackexchange.com/a/586735/134144 might be helpful. – leandriis May 12 '21 at 14:07
  • You can use \textbullet~~Insert responsibility where the tilde ~ forces some space. – Partha D. May 13 '21 at 09:59
  • @leandriis, link you given in comment for sure can be helpful regardless that it not offer all possible solution. Also there is not emphasized specifics of the case with one item with of one line item text (close to this is Bernard answer). So I doubt that this question is just duplicate. Actually the question in link is also duplicate since similar question are around for years :-) – Zarko May 14 '21 at 03:16

2 Answers2

1

See if this suggestion can help you:

\documentclass{article}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}

\begin{document} \begin{table}[h] \setlist[itemize]{nosep, leftmargin=*, label=\textbullet, before=\begin{minipage}[t]{\linewidth}, after=\end{minipage} } \setcellgapes{3pt} \makegapedcells \begin{tabular}{|p{4cm}|p{9cm}|} \hline \thead[l]{Role} & \thead[l]{Responsibilities} \ \hline Insert Role & \begin{itemize} \item Insert responsibilitytext, text, text, text, text, text, text, text, text, text, text, text, text, text, \end{itemize} \ \hline Insert Role & Aufzählung \ \hline Insert Role & Aufzählung \ \hline Insert Role & Aufzählung \ \hline \end{tabular} \end{table} \end{document}

Note: as you define table width it spill out of page. So I reduce column width and add package geometry.

Edit: Above solution works fine as long you have in cell a list with one item with two lines of texts or two items. In the case of one sort, one line item, is better to use the following solution:

\documentclass{article}
\usepackage{geometry}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\newcolumntype{P}[1]{>{\csname @minipagetrue\endcsname}p{#1}} % <---
\usepackage{enumitem}

\begin{document} \begin{table}[h] \setlist[itemize]{nosep,
leftmargin=*, label=$\bullet$, after=\vspace{-\baselineskip} }

\setcellgapes{3pt} \makegapedcells \begin{tabular}{|p{4cm}|P{9cm}|} \hline \thead[l]{Role} & \thead[l]{Responsibilities} \ \hline Insert Role & \begin{itemize} \item Insert responsibility \end{itemize} \ \hline Insert Role & Aufzählung \ \hline Insert Role & Aufzählung \ \hline Insert Role & Aufzählung \ \hline \end{tabular} \end{table} \end{document}

enter image description here

You may prefer (especially in cases when you have more tables with lists in the tables' cells) to move list settings used in table to preamble and make it with with help of etoolbox package global for tables:

\usepackage{etoolbox}
\AtBeginEnvironment{table}{%
\setlist[itemize]{nosep,
                  leftmargin=*,
                  label=$\bullet$,
                  after=\vspace{-\baselineskip}
                  }
                          }
Zarko
  • 296,517
0

Using \textbullet~~

Image

(inspired by @Zarko's use case of long wrapped line in a table cell)

Simpler, but devoid of the hanging indent !

Achieved with this code--

\documentclass[10pt]{article}
\usepackage{enumitem}
\begin{document}
\begin{table}[h]
\renewcommand{\arraystretch}{1.5}
    \begin{tabular}{|p{4.5cm}|p{5.5cm}|}
    \hline
    \textbf{Role} & \textbf{Responsibilities} \\ \hline
    Insert Role & \textbullet~~Insert responsibility \\ \hline
    Insert Role & \textbullet~~Insert responsibility that is really a long 
                     list of items spilling to the next line \\ \hline
    Insert Role & Aufzählung \\ \hline
    Insert Role & Aufzählung \\ \hline
    \end{tabular}
\end{table}
\end{document}
Partha D.
  • 2,250
  • How do you align the text Insert responsibility that is really a long list of items spilling to the next line where all the text aligns to the right of the bullet in every line? – kowalski Mar 29 '23 at 02:37
  • That can be done with \begin{itemize} \item Insert responsibility ... \end{itemize} with indents and widths adjustable by appropriately setting enumitem parameters described here. – Partha D. Mar 30 '23 at 16:45