title: LaTeX: remove left margin of listing inside a table
body: <p>Using <em>LaTeX</em>, I need to show some code snippet inside a table.  Here is an example of what I'm trying to do:</p>
  
  <pre><code>\begin{document}
  Par exemple :
  \begin{center}
  \begin{tabular}{lp{5cm}l}
  \hline
  Méthode &amp; Description &amp; Exemple d'utilisation\\
  \hline
  \texttt{isLetter()}&amp; Indique si le caractère est une lettre de l'alphabet. &amp;
  \begin{lstlisting}[numbersep=0pt]
  QChar MyChar('x');
  bool IsLetter = MyChar.isLetter();
  \end{lstlisting} \\
  \hline
  \texttt{toUpper()}&amp; Retourne le même caractère mais en majuscules. &amp; toto \\
  \hline
  \end{tabular}
  \end{center}
  \end{document}
  </code></pre>
  
  <p>Here is the result I get :</p>
  
  <p><a href="https://i.stack.imgur.com/ONAdx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ONAdx.png" alt=""></a>
  .</p>
  
  <p>As you can see, there is a margin on the left of the code. I guess this margin is there for numbering, but I don't need numbering and would like to get rid of it. I've tried changing some options (<code>numbersep</code>, <code>xleftmargin</code>) but none is working as I wish.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here is the full document demonstrating the problem :</p>
  
  <pre><code>\documentclass[a4paper,11pt]{article}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{lmodern,textcomp}
  \usepackage[frenchb]{babel}
  \usepackage{listings}
  
  \begin{document}
     \begin{enumerate}
     \item Par exemple :
        \begin{center}
        \begin{tabular}{lp{5cm}l}
        \hline
        Méthode &amp; Description &amp; Exemple d'utilisation\\
        \hline
        \texttt{isLetter()}&amp; Indique si le caractère est une lettre de l'alphabet. &amp;
        \begin{lstlisting}[numbersep=0pt]
  QChar MyChar('x');
  bool IsLetter = MyChar.isLetter();
  // IsLetter vaut vrai
  QChar MyChar2('&amp;');
  IsLetter = MyChar2.isLetter();
  // IsLetter vaut faux
        \end{lstlisting}\\
        \hline
        \texttt{toUpper()}&amp; Retourne le même caractère mais en majuscules. &amp; toto \\
        \end{tabular}
        \end{center}
     \end{enumerate}
  \end{document}
  </code></pre>
  
  <p>I can deduce that the problem is because the table is in a item of an enumeration.</p>
  
  <p>Is there a way to solve this ?</p>