How to autoSize table cells generated via iText - seam

How to autoSize table cells which was generated by seam pdf plugin (via iText)

You can use widthPercentage
<p:table columns="2" headerRows="1" widthPercentage="95">
Then your cells should automatically fill that width

Related

Rendering an excel sheet in R on screen with proper formatting

I would like to render (show on screen) the contents and the formatting of an excel sheet in a Shiny app. At a minimum I would like to set the column widths and row heights as in the Excel sheet.
I am currently rendering the sheets using DT::datatable. By default the column widths are set to fit the content, which is not how to sheet looks like when opened in a spreadsheet editor.
How do I set the widths and heights of each row and column individually in DT::datatable or an alternative tool?

Autocontrol of table width

I am using dynamically generated table with knitr. Sometimes the tables are small and fit within the text width while other times it is large and one can use the following solution: Automatically adjust LaTeX table width to fit pdf using knitr and Rstudio
Just wondering if there is a way to use \textwidth only when when the table width is larger than the \textwidth? In automatic reporting sometime tables are large and sometime tiny. Using full text width generated awkward huge font table.

Panel grid layout or stretch panel?

I'm creating a page based on a template to present a query with results table and when i select a result the same data as to be presented on the side as a form.
I have tryed to do it inserting a panel grid layout with some cells, so each cell will have the query form, another to the results table and other details that i have to insert.
This is the basic layout:
When i change the cell poperties so i can see the table and everything else, one of two things happen, the table fills all the page (width) or it stays very small and i have to use the scroll bar to see all the data. What i want is that the table use all the width available in the cell.
Can someone help me doing this with a grid layout or is there another way, such as a stretch layout that i can use?
Thanks
I'd say just use two nested stretch layouts, will give you good and clean result.
<af:panelStretchLayout>
<f:facet name="top">
<!-- fixed size header -->
</f:facet>
<f:facet name="start">
<!-- fixed size menu -->
</f:facet>
<f:facet name="center">
<af:panelStretchLayout>
<f:facet name="top">
<!-- search form -->
</f:facet>
<f:facet name="end">
<!-- right block -->
</f:facet>
<f:facet name="center">
<!-- table -->
</f:facet>
</af:panelStretchLayout>
</f:facet>
</af:panelStretchLayout>
Don't forget to set stretching option for components that need it.
Assuming that menu and header are part of a template which you are using in your page, here is one way to achieve your layout structure
- panelStretchLayout
- facet name="center"
- panelGroupLayout (layout="vertical" styleClass="AFStretchWidth")
- search form
- panelStretchLayout (endWidth="100px" dimensionsFrom="auto")
- facet name="center"
- table ( columnStretching="last" styleClass="AFStretchWidth")
- facet name="end"
- form
How did you define your cells? Set the first and last cell width to a fixed size.
Then the middle cell should have the halign=stretch.
From the doc:
http://docs.oracle.com/cd/E26098_01/apirefs.1112/e17491/tagdoc/af_gridCell.html
This component can stretch a child component if (1) it is the only component inside of the gridCell, (2) the cell's "halign" is "stretch", (3) the cell's "valign" is "stretch", (4) the effective width of the cell is non-auto, and (5) if the effective height of the cell is non-auto.
I suggest using panel grid layout, ADF improved panel grid layout component in version 11.1.2
An ADF application normally starts with a stretchable outer layout container that stretches its children so make the outer layout panel grid with a 100% height row and 100% width
The benefit of panel grid it matches the way HTML tables are laid out, so it offers good performance compared to other ADF layout components.

Stretch twitter bootstrap table cell across entire table for description

I'm trying to format the first row of my table using twitter bootstrap html/css to stretch across all the table headers so that I can use it as a description - like the row with bold font reading "Build Agency Leader Characteristics to Support..." in the image below. When I use td with custom widths, or try to drop text directly into the table row, it doesn't work.
Got it - just had to add attribute colspan=5 to a new table header.

mPDF: long text in table td shrinks to small size

I am posting an entire html to mpdfp. It works fine. But when the content in table is more or there is an email address or website name in the column (td) the font size of the text shrinks to unreadable font. What must be the issue? Please help on this. Check the attached image for the issue.
Thanks
As noted in this question: mPDF: Text becomes small when string in table is too long
mPDF automatically reduces font size in tables. There is a maximum shrink factor set in $this->shrink_tables_to_fit variable in config.php. It can be turned off / set differently with
$mpdf->shrink_tables_to_fit=0;
in config.php or with providing an extra parameter to the opening table tag:
<table autosize="1">
Default value for the variable is 1.4.
Also see Tables section of mPDF manual https://mpdf.github.io/tables/tables.html#autosize, especially the infobox Note: mPDF will always resize tables if it is the only way to fit a row or whole table onto a full page.

Resources