问题
The link has a table in a PDF generated using Apache-FOP.
I am unable to remove the blank spaces/empty spaces in the table column headers and column values.
The PDF has limitation of 120 characters and thus unable to display all the text.
The application does supply the column width. But unsure how to use it in the xsl-fo file
Please suggest how to define widths of the table columns to hold only the text and without any blank/unused spaces.
回答1:
Use fo:table-column
(see https://www.w3.org/TR/xsl11/#fo_table-column) and the column-width
property to specify the width of each column. For example:
<fo:table-column column-width="100pt" column-number="1" />
If you generate the fo:table-column
in sequence, then you can omit the column-number
property (see https://www.w3.org/TR/xsl11/#column-number).
If you are using FOP, it still doesn't implement automatic table layout, so you probably also have to set the table width to be the sum of the column widths plus the border widths.
来源:https://stackoverflow.com/questions/16005263/remove-whitespace-blank-spaces-in-table-columns-xsl-fo