Latex et tabular

L'informatique en général

Modérateur : Modérateur

JP
Administrateur
Administrateur
Messages : 2323
Inscription : 23 sept. 2003 18:14
Localisation : Strasbourg
Contact :

Latex et tabular

Message 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
Ca clignote !!!!

Michael
HABITUE
HABITUE
Messages : 63
Inscription : 08 sept. 2005 11:33
Localisation : Paris

Message 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+

JP
Administrateur
Administrateur
Messages : 2323
Inscription : 23 sept. 2003 18:14
Localisation : Strasbourg
Contact :

Message 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
Ca clignote !!!!

Répondre