On Tue, Mar 13, 2001 at 05:43:39PM +0200, Tuukka Toivonen wrote:
> I just can't understand LyX tables. I upgraded to 1.1.6fix1 and I still
> have the same problem(s). Let's start from simple:
> 
> How can I set both Table Column Width and Horizontal Alignment?
> 
> - It's impossible to use both Tabular Layout/Column/Row/Width and
>   H. Alignment.
> - I can set the Paragraph Layout/General/Alignment but this gives LaTeX
>   errors.

The problem is the code generated by the LyX (i.e. this is a bug!)

\begin{tabular}{|c|c|c|c|p{2cm}|}
...
\raggedleft fd gf ggf\\

The \raggedleft command redefines the \\ command, and therefore the end of
the row is misinterpreted.
The problem appears only when you have a constant width column at the last
row, and you use left/right/center alignment in one of the cells.
It shouldn't be hard to fix the bug (lyx should add a parbox in such cases).

A temporary solution is to add a dummy column row to the table (see attached
file).
#LyX 1.2 created this file. For more info see http://www.lyx.org/
\lyxformat 218
\textclass article
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Standard


\begin_inset  Tabular
<lyxtabular version="2" rows="5" columns="6">
<features rotate="false" islongtable="false" endhead="0" endfirsthead="0" endfoot="0" 
endlastfoot="0">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" 
special="">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" 
special="">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" 
special="">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" 
special="">
<column alignment="left" valignment="top" leftline="true" rightline="true" width="2cm" 
special="">
<column alignment="left" valignment="top" leftline="false" rightline="false" width="" 
special="">
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard
\align right 
fd gf ggf
\end_inset 
</cell>
<cell multicolumn="1" alignment="left" valignment="top" topline="false" 
bottomline="false" leftline="false" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard
\align right 
gfgf
\end_inset 
</cell>
<cell multicolumn="1" alignment="left" valignment="top" topline="false" 
bottomline="false" leftline="false" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

fdg dgf dgd
\end_inset 
</cell>
<cell multicolumn="1" alignment="left" valignment="top" topline="false" 
bottomline="false" leftline="false" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

fgdfg f f fd fd df
\end_inset 
</cell>
<cell multicolumn="1" alignment="left" valignment="top" topline="false" 
bottomline="false" leftline="false" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
<cell multicolumn="0" alignment="left" valignment="top" topline="true" 
bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

gfd fgd fd fd df fd
\end_inset 
</cell>
<cell multicolumn="1" alignment="left" valignment="top" topline="false" 
bottomline="false" leftline="false" rightline="false" rotate="false" usebox="none" 
width="" special="">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
</lyxtabular>

\end_inset 


\the_end

Reply via email to