[Tex/LaTex] Raggedright not working inside a table

horizontal alignmentragged2etables

I have a table and i want to align elements left.
This is my code :

\begin{tabular}{|c|c|}
  \hline 
   Priorité&Description \\
   \hline
   \multirow{4}{16 mm }{\centering 0}
   & \tabitem \raggedright Documentation.\tabularnewline 
   & \raggedleft \tabitem  Analyse et critique de quelques navigateurs pour enfants existant.\tabularnewline 
   & \raggedleft \tabitem  Description de la solution souhaitée.\tabularnewline 
   & \raggedleft \tabitem  Modélisation et implémentation de la base de données.\tabularnewline 
  \hline
  \multirow{2}{8 mm }{\centering 1}
  & \raggedleft \tabitem Conception et développement du navigateur.\tabularnewline 
  & \raggedleft \tabitem Globalisation du navigateur.\tabularnewline 
 \hline
 \multirow{2}{8 mm }{\centering 2}
 & \raggedleft \tabitem Conception et développement du Dashboard administrative.\tabularnewline 
 & \raggedleft \tabitem Conception et développement du Dashboard parental.\tabularnewline 
\hline
\centering 3&
\raggedleft \tabitem Intégration du navigateur avec le projet Famissima.\tabularnewline
\hline
\end{tabular}

can anyone help me.
and this is the \tabitem:

\usepackage{booktabs}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

Best Answer

You have to use pcolumn type to get \raggedright/left working. Also, if you are adding \tabitem in every cell of a column, add it to the column specifier (an array package feature) instead of repeating it. \arraybackslash will allow you to use \\ as usual.

\documentclass{article}
\usepackage{array,multirow,calc}
\usepackage{booktabs}
\usepackage[utf8]{inputenc}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
\newlength\mylength
\setlength{\mylength}{\widthof{Priorité}}
\begin{document}
\noindent
  \begin{tabular}{|c|>{\raggedleft \tabitem\arraybackslash}p{\dimexpr\textwidth-\mylength-4\tabcolsep-3\arrayrulewidth\relax}|}
  \hline
   Priorité& \multicolumn{1}{c|}{Description} \\
   \hline
   \multirow{4}{*}{0}
   & \multicolumn{1}{l|}{\tabitem Documentation.}\tabularnewline
   &  Analyse et critique de quelques navigateurs pour enfants existant.\tabularnewline
   & Description de la solution souhaitée.\tabularnewline
   & Modélisation et implémentation de la base de données.\tabularnewline
  \hline
  \multirow{2}{*}{1}
  &  Conception et développement du navigateur.\tabularnewline
  & Globalisation du navigateur.\tabularnewline
 \hline
 \multirow{2}{*}{2}
 & Conception et développement du Dashboard administrative.\tabularnewline
 & Conception et développement du Dashboard parental.\tabularnewline
\hline
3&
Intégration du navigateur avec le projet Famissima.\tabularnewline
\hline
\end{tabular}
\end{document}

enter image description here

Related Question