0

I want to position the text at the top of the box as it is declared, but when the column on the right contains a long text, it automatically changes to the bottom of the box

\documentclass[12pt]{report}

%% Je suis francophone !
\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fancybox}
%% Je veux utiliser néanmoins des fontes qui « paraissent bien » en PDF
\usepackage[cyr]{aeguill}
\usepackage[table,svgnames]{xcolor}
\newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash }b{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash }b{#1}}
\begin{document}
\begin{center}
\begin{table}[h]
\begin{tabular}{||C{0.5cm}||C{5cm}||C{4cm}||C{6.5cm}||} 

\hline 
\cellcolor{Gray} \textbf{RG} & \textbf{Définition} & \textbf{Mapping} & \textbf{Règles de gestion spécifiques}\\  
\hline
\hline  
\multicolumn{1}{||L{0.5cm}|}{\parbox{0.5cm}{1}} & \multicolumn{1}{|L{5cm}|}{\footnotesize {Portail \-Date Traitement Courant}} & \multicolumn{1}{|L{4cm}|}{\scriptsize{RBP \_ vTBADMRBP \_ SUIVI \_ APPLI.D \_ TRAIT}} & \multicolumn{1}{|L{6.5cm}||}{\footnotesize {CASE
WHEN [RBP \- Presentation View].[Dimension \- Référentiel Datamart].[L\_DATMR] = 'PORTAIL' THEN [RBP \- Presentation View].[Fait \- Suivi Application].[D\_TRAIT]
END}} \\
\hline 
\end{tabular}
\caption{Équipe de travail}
\end{table}
\end{center} 
\end{document}

enter image description here

Torbjørn T.
  • 206,688

1 Answers1

3
  • your question is duplicate to your question position-text-at-the-top-of-cell-in-table
  • your question is answered in the comments under your the first and this questions
  • beside this problem your document has other issues as:

    • float had not be inside other environments, ie. your

      \begin{center}
      \begin{figure}[h]
      ...
      \end{table}
      \end{center}
      

      is wrong

    • table width is larger than text width, consequently it spill out of a page
    • what means \-?
    • to my taste table is ugly :-( (about table design is worth a look Wie Tabellen eigentlich aussehen sollten:

see, if the following redesign of your table is acceptable to you:

\documentclass[svgnames,    % option for color napes
               french,      % option for babel (Je suis francophone!)
               12pt]{report}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{cfr-lm}         % instead of the "[cyr]{aeguill}"

\usepackage[table]{xcolor}
\usepackage{ragged2e}       % new
\usepackage{booktabs,       % new
            makecell,       % new
            tabularx}       % new
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X} % redefined

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{table}[htb]
    \footnotesize
    \setlength\tabcolsep{4pt}
\begin{tabularx}{\linewidth}{@{}
    >{\large}c
    >{\hsize=0.25\hsize}L
    >{\hsize=0.25\hsize}L
    >{\hsize=0.50\hsize}L   @{}}
    \toprule
\thead[l]{RG}
    &   \thead[l]{Définition}
        &   \thead[l]{Mapping}
            &   \thead[l]{Règles de gestion spécifiques}                                               \\
    \midrule
1   & Portail Date Traitement Courant
        & RBP vTBADMRB \_SUIVI\_APPLI.D \_TRAIT
            &   CASE WHEN

                [RBP Presentation View].[Dimension Référentiel Datamart].[L\_DATMR]

                = 'PORTAIL' THEN [RBP  Presentation View].[Fait Suivi Application].[D\_TRAIT] END  \\

    \bottomrule
\end{tabularx}
\caption{Équipe de travail}
\end{table}
\end{document}

enter image description here

(red lines indicate page layout)

edit: i consider comment of Torbjørn T. and accordingly corrected text in table.

Zarko
  • 296,517
  • \- is used to manually indicate a hyphenation point (e.g. hyphe\-nation), but used between words as here it's quite unnecessary. – Torbjørn T. May 26 '18 at 09:04
  • i know this, but not on the way how op used, for example Fait \- Suivi. this hasn't any sense (is superfluous). i suspect that op try to write Fait\_Suivi, (what also has sense :-) ). i will correct my answer asap. – Zarko May 26 '18 at 09:10
  • Ah, sorry. Might just be due to a misunderstanding of what \- does. – Torbjørn T. May 26 '18 at 09:12
  • @TorbjørnT., thank you very much for editing my answer and for comment about \-. in the first my comment i try to write "(what also hasn't much sense :-) )" . i corrected text in table accordingly. – Zarko May 26 '18 at 09:21