- From: Giuseppe Briotti <g.briotti@gmail.com>
- Date: Mon, 23 May 2011 17:00:44 +0200
- To: www-xsl-fo@w3.org
- Message-ID: <BANLkTimr+ZfS1jk-AZw9jaQma8gDwK3kFw@mail.gmail.com>
Hi all, and sorry for this probably trivial question: what I need: 1. a structure (that for semplicity we can call "table") based on 3 rows and 2 columns (i.e. 2 cells per row) 2. this structure must be fixed in height (say 20cm) 3. the rows must have a preferable height of 30%, 40%, 30% as optimum but must be able to change the height accordingly with the cell content what I try: 1. it seems that a real fo:table with a good usage of block-progression-dimension (.minimum, .optimum, .maximum) should fit very well for such problem. Thus i write some code (a table with just one cell per row, to keep the things simple): Unfortunately, with FOP 0.95 this seems not work (btw, I cannot use percentage - probably due to FOP problem): <?xml version="1.0" encoding="UTF-8"?> <fo:root text-align="center" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="A4_1" margin="1cm" page-width="21cm" page-height="29.7cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4_1"> <fo:flow flow-name="xsl-region-body"> <fo:block-container block-progression-dimension="20cm" > <fo:table table-layout="fixed" width="100%" block-progression-dimension="20cm" > <fo:table-body> <fo:table-row > <fo:table-cell block-progression-dimension.optimum="6cm" block-progression-dimension.minimum="4cm" block-progression-dimension.maximum="8cm" border="solid"> <fo:block>place long text here</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row > <fo:table-cell block-progression-dimension.optimum="8cm" block-progression-dimension.minimum="6cm" block-progression-dimension.maximum="10cm" border="solid"> <fo:block>place long text here</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row > <fo:table-cell block-progression-dimension.optimum="6cm" block-progression-dimension.minimum="4cm" block-progression-dimension.maximum="8cm" border="solid"> <fo:block>place long text here</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block-container> </fo:flow> </fo:page-sequence> </fo:root> Placing a long text in a cell, the cell height grows up to include all the text, regardless the block-progression-dimension. I placed a block container around the table with no success. I try to place a block-container inside the table-cell defining its own block-progression-dimension.* but no way (in this case, the cell and block-container height result in optimum (6cm) and the inner block with text overflow, even if the text length fill in the block-progression-dimension.maximum size). Assuming that probably I have some problem with tables :-) I try a "only block containers solution": <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="PM"> <fo:region-body margin-top="20mm" margin-left="20mm" margin-right="20mm" margin-bottom="20mm"/> <fo:region-before extent="20mm" /> <fo:region-after extent="20mm" /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="PM"> <fo:flow flow-name="xsl-region-body"> <!-- block container for the whole "table" --> <fo:block-container > <!-- first "table row" --> <fo:block-container block-progression-dimension.minimum="2cm" block-progression-dimension.optimum="6cm" block-progression-dimension.maximum="9cm" border="solid 1pt" background-color="yellow" > <fo:block block-progression-dimension="100%"> <fo:inline> long text here </fo:inline> </fo:block> </fo:block-container> <!-- second row --> <fo:block-container block-progression-dimension.minimum="2cm" block-progression-dimension.optimum="8cm" block-progression-dimension.maximum="10cm" border="solid 1pt" > <fo:block block-progression-dimension="100%" > <fo:inline > long text here </fo:inline> </fo:block> </fo:block-container> <!-- last row --> <fo:block-container relative-position="relative" block-progression-dimension.minimum="2cm" block-progression-dimension.optimum="6cm" block-progression-dimension.maximum="9cm" border="solid 1pt" background-color="yellow" > <fo:block block-progression-dimension="100%"> <fo:inline> long text here </fo:inline> </fo:block> </fo:block-container> </fo:block-container> </fo:flow> </fo:page-sequence> </fo:root> No way again. So I must assume that probably I didn't understood how block-progression-dimension.* works :-( Questions: 1. Any hint? 2. What I'm missing? 3. There is another way? 4. There is a way to extimate the height required, assuming that I know the text lenght and font parameters, in order to programmaticaly set the row height? TIA Giuseppe -- Giuseppe Briotti g.briotti@gmail.com "Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius." (Orazio)
Received on Tuesday, 24 May 2011 07:10:45 UTC