Copy link to clipboard
Copied
I am working on a pulication with a gazillion tables. I need to reformat the text in the table to a smaller size, and when I do that, I am left with empty space in all the rows like this. How do I make the table rows fit in smart manner without having to adjust every single row?
The setting is saved as part of a table format, so after applying this setting you can make a table format (object) and newly made table susing the format will behave "correctly".
Existing tables will not be altered automatically.
So maybe just applying the new/altered table format is working (never tested that) or you have to go through all existing tables to apply the new cell height settings.
Regards
Stephan
Copy link to clipboard
Copied
Hi Bjørn ( @FrameMaker-dk ),
mark the cell or a column of the table to change all cell-heights, right-click on marked area, click on "Row format" (in german "Zeilenformat") and change the minimum to "0" and the maximum to "355,601 mm" (max. that FM accepts).
Now the height of your cells changes with the change of the content between the minimum and the maximum.
Regards
Stephan
Stephan
Copy link to clipboard
Copied
Thank you @mk-will . That will work. So... no way to do this using the table tags or some other global setting?
Copy link to clipboard
Copied
The setting is saved as part of a table format, so after applying this setting you can make a table format (object) and newly made table susing the format will behave "correctly".
Existing tables will not be altered automatically.
So maybe just applying the new/altered table format is working (never tested that) or you have to go through all existing tables to apply the new cell height settings.
Regards
Stephan
Copy link to clipboard
Copied
Thank you @mk-will Tried the make a new table tag, but was not able to make it work, ufortunately. I shall have to do this manually 🙂
Copy link to clipboard
Copied
Bjørn, here is a script that will work on the selected table. It resets all of the row heights to the FrameMaker default. Please let me know if you have a lot of tables, and I can expand it to work on all tables in the document.
main ();
function main () {
var doc;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
processDoc (doc);
}
}
function processDoc (doc) {
var tbl;
// Get the table with the text cursor in it.
tbl = doc.SelectedTbl;
if (tbl.ObjectValid () === 1) {
processTbl (tbl, doc);
}
}
function processTbl (tbl, doc) {
var PT, row;
// Metric value for a Postscript point.
PT = 65536;
// Process all of the rows in the table.
row = tbl.FirstRowInTbl;
while (row.ObjectValid () === 1) {
// Set the row minimum and maximum heights.
row.RowMinHeight = 0;
row.RowMaxHeight = 1008 * PT;
row = row.NextRowInTbl;
}
}
Copy link to clipboard
Copied
Thank you for the script, @frameexpert ! Works excellently! This was very kind of you! I quite often use your other table cleaning scripts - they are amazing and enormous help with documents where there have been a lot of edits and different editors.
Copy link to clipboard
Copied
Row Formatting is not saved as part of a table format. Did you check the minimum and maximum row heights? If the row height is not changing to fit the content, that is the likely cause. But someone had to set those row height values because they are not saved as part of a table format.
Copy link to clipboard
Copied
Hi @frameexpert ,
Row Formatting is not saved as part of a table format.
are you sure?
Afaik it must be stored somewhere in the (binary) FM files as all my tables (using the same format) have the same setting about minimum and mximum since I changed that in the past and stored that table format.
In a MIF I can find:
<RowMaxHeight 355.60067 mm>
<RowHeight 5.64445 mm>
But these entries relay as it seems only to existing tables in the file.
Regards
Stephan
Copy link to clipboard
Copied
Try this:
Copy link to clipboard
Copied
Probably not relevant for you.
When you have a hidden column with a condition which has more lines than the other columns (e.g. 4 lines), then the height of the table row will adjust to these 4 lines, although they are hidden.