Page 1 sur 1

Latex et tabular

Publié : 22 nov. 2006 18:07
par JP
Hello,

Est ce que quelqu'un peut m'expliquer pourquoi je n'arrive pas à compiler mon tableau :

Code : Tout sélectionner

\begin{tabular}{|>{\centering}m{2cm}|>{\centering}m{2cm}|>{\centering}m{3cm}|>{\centering}m{3cm}|}
\hline  a & b & c & d \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline  &  &  &  \\ 
\hline 
\end{tabular} 
Quand il est vide ca fonctionne très bien et quand je remplie la 1er ligne :
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.20 \hline
& & & \\
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.

! Extra alignment tab has been changed to \cr.
<recently read> \endtemplate

l.20 \hline &
& & \\
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.
merci
a+
JP

Publié : 24 nov. 2006 18:27
par Michael
Je connais pas trop l'environnement tabular mais il me semble que ca viens des \hline
Tu n'a besoin que d'un au début et un a la fin

Code : Tout sélectionner

\begin{tabular}{|c|c|c|c|}
\hline  
a & b & c & d \\
e & f & g & h  \\
\hline 
\end{tabular}
voila regarde aussi si ce n'est pas ton entete qui foire

a+

Publié : 24 nov. 2006 22:33
par JP
Un tableau "standard", pas de problème, mais il me faut un centrage vertical et une taille de colonne bien définie.
Pour les \hline, il m'en faut pour chaque ligne.
Pour l'entête, ca doit être bon, tout est reconnu correctement les m{] le > etc
Ca plante juste si je fixe le centrage et la largeur pour toutes les colonnes