Can't Adjust Column Width in Table

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Telecaster52
Propeller Head
Posts: 32
Joined: Tue Dec 01, 2020 2:22 pm

Can't Adjust Column Width in Table

Post by Telecaster52 »

How do I adjust a column width in a table using the XML editor? I've tried clicking the column and changing the px or % values, but nothing happens. No cells are merged. I am not touching the text editor, because I don't want to break the table. Also, I don't want to change the table style. Just one individual table.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Can't Adjust Column Width in Table

Post by Nita Beck »

It's not clear to me what you're asking. You mention both resizing and merging. Are you trying to resize or to merge? I *think* you're asking about resizing.

Resizing a column can get tricky if there is a table stylesheet applied and that stylesheet has column styles for controlling column widths. (And the medium may also come into play.) For example, I've designed table stylesheet that have column styles for 20%, 30%, 40%, etc., of the table's full width. Then to resize a column, I apply that style to it.

As a last resort to resize, you can drag the divider between a column and its neighbor to resize the column. That'll introduce inline formatting, which I don't recommend, but it'll achieve the resize. I don't recommend inline formatting for columns because what may look good for one type of output -- say PDF -- may look decidedly not good for another -- say HTML5.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Telecaster52
Propeller Head
Posts: 32
Joined: Tue Dec 01, 2020 2:22 pm

Re: Can't Adjust Column Width in Table

Post by Telecaster52 »

You don't understand my question? It sounded pretty straightforward, and it sounds like you did understand it, since you responded. :?

None of those options worked. I'll have to open a ticket. Thanks!
robdocsmith
Sr. Propeller Head
Posts: 265
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Can't Adjust Column Width in Table

Post by robdocsmith »

What happens when you right click the column in the span structure bars* above the editor, then change the value listed there? Does the column not change width? Hard to tell what is happening. In the text editor, after changing a column width, you should see something like:

Code: Select all

<table ... >
   <col style="width:value;"...>
   <col style="width:value;"...>
etc.

Those are the inlne styles that Nita was talking about. Better to set column widths in table styles and set for each medium. Myself, I only work with PDF so am OK with these inline styles. I dare say this will return to bite me one day...

* If you can't see the span structure bars, click the tiny drop down arrow next to the Toggle Show Tags icon in the xml editor toolbar.
robdocsmith
Sr. Propeller Head
Posts: 265
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Can't Adjust Column Width in Table

Post by robdocsmith »

That being said... changing column widths in Flare can be ... entertaining... sometimes. Flare wants to make column widths fit text using some algorithm of its own. As you type in a table the columns can jump around in width if no column widths are defined in styles or inline. Dragging a column divider might have no effect or might have the wrong effect depending on the text. I like to make sure that I either have all columns adding to 100% width, or leave one set to auto to adjust to fill the remaining space.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Can't Adjust Column Width in Table

Post by SteveS »

Telecaster52 wrote:You don't understand my question? It sounded pretty straightforward, and it sounds like you did understand it, since you responded. :?

None of those options worked. I'll have to open a ticket. Thanks!
Pull your head in, mate.
Everyone gives their time freely and does their best to help others. If they seek clarification, it's because they want to answer your query as well as possible.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
cayennep
Sr. Propeller Head
Posts: 394
Joined: Mon Jul 26, 2010 3:42 pm

Re: Can't Adjust Column Width in Table

Post by cayennep »

This is old so we'll see if anybody picks it up, but...

I've read all the suggestions - and had already tried them - but cannot resize columns by dragging or by changing to a % in the column tag.
Sometimes it seems to refuse because one cell in the column has longer text (with no space) but it still gives big margin/padding AND, if I want the text to wrap I should be the boss of that!

Really annoying, happens reasonably often and I end up having to just accept how Flare wants it to look (really bad) instead of actually being able to modify and have it how I want it to look.

Tips appreciated, did not see a valid answer here but be assured the table style nor anything contains this, and I WANT to use inline styles.
thanks
Psider
Propellus Maximus
Posts: 860
Joined: Wed Jul 06, 2011 1:32 am

Re: Can't Adjust Column Width in Table

Post by Psider »

That's the way html tables work, rather than being something Flare is doing. The width and height adjust to fit the content if there are no wrapping opportunities e.g. a long string with no spaces or hyphens.

You could try adding wordbreak: break-all; to the table or td definition (I'm unsure if there will be different behaviour by specifying on table; I would personally set it on td, but you could try out either.) This property will force a break between 2 characters if the string would overflow its container (except for Chinese, Japanese, Korean text)

This obviously won't have any effect if you insert an image. In this case the column will expand to fit the image, unless you specifically size the image to fit inside the column.

Here's the info on word-break
https://developer.mozilla.org/en-US/doc ... word-break

And the w3schools site so you can try plugging in values to see what happens to the table:
https://www.w3schools.com/html/tryit.as ... able_width

e.g. try changing 'Jill' to 'ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'. Click Run to confirm the column expands to accommodate the text. Then add td {width: 15%; word-break: break-all;} inside the style tags and Run again to confirm the column wraps.
cayennep
Sr. Propeller Head
Posts: 394
Joined: Mon Jul 26, 2010 3:42 pm

Re: Can't Adjust Column Width in Table

Post by cayennep »

Psider - thanks so much for clarifying!

It looked like that, 'cos dev gives me long API params - part1.thing2.anotherpiece.yetmore@finaldestination\

Confirms what I thought - as I work to move this into tables that more accurately show this structure, tables will look better and first column won't be so long. Good motivation!

It makes sense, but these details appreciated, thanks
TWinMontreal
Jr. Propeller Head
Posts: 5
Joined: Fri Jun 15, 2018 10:33 am

Re: Can't Adjust Column Width in Table

Post by TWinMontreal »

Hello! I had this issue with the left column in a table, where the innocuous label for my header, "Settings", somehow started breaking in the middle, despite having been okay in my project for about two years. That left the whole table looking very bad, so I couldn’t ignore it. Psider, I also tried your amazing suggestions (word-break, w3 schools), and thanks for your post – I found it interesting what you mentioned about Flare not really being the issue: “That's the way html tables work, rather than being something Flare is doing. The width and height adjust to fit the content if there are no wrapping opportunities e.g. a long string with no spaces or hyphens.”

I tried the following, but still got the same behavior until something from the mists of my time doing this bubbled up to the surface or an inspiration dawned – read on):
1. Adjusting the various table properties settings (Autofit to contents, Autofit to window, Fixed column width,
2. Removing the properly sized screen caps from some rows,
3. Rolling back to earlier versions of the file in Gitlab (source control),
4. Manually adjusting column widths by selecting the column headers in the XML editor,
5. Manually setting column 1 and column 2 widths in the Text editor,
6. Googling this and finding this thread, I then applied the word-break: keep-all setting to the table and td selectors in my stylesheet,
7. Recreating the table but copying and pasting the existing content (I missed a clue there, as I went to quickly),
8. Copying the file to a test project,
9. Creating a new file and copying the table into it.

Just as I was about to log a ticket with MadCap, a better troubleshooting idea dawned:

10. Deleting a row at a time in the table. It turned out that a snippet in column two was now causing this issue, where it hadn’t before.

So it seems we can add snippets to the list of things that can break column auto-resizing (Psider’s term “wrapping opportunities”) – sometimes anyway. And oddly enough the snippet was in column 2 but column 1 had the issue. Hope it helps and I add to the good karma by adding this :D

Gordon Brown aka Giordano Bruno - Montreal
jbananak
Propeller Head
Posts: 68
Joined: Thu May 03, 2012 2:45 am

Re: Can't Adjust Column Width in Table

Post by jbananak »

HI.
I've also tried all the possible solutions, but as soon as I add an image or 'something' which is apparently not within the size limits of the cell, it changes the table columns. Also, often if you remove the image, it doesn't return to the size it was... and it is totally random the way it automatically resizes itself.
So even if, for example, you decide to resize the image before putting it in because it was apparently too big, then your table is already messed up..., and yes I can close without saving, but then 1. there's a good chance I lose other changes, cos you never know when a table is gonna jump and you can't save after every cell, and 2. This is not a practical solution, closing and opening files to format a table....
This problem with tables has been going on for years. For a tool that is supposed to be the 'serious' option for professional/technical writing (as opposed to MS Word), and whose price has doubled the last couple of years... it is a real disappointment that there is not yet a clear, understandable working solution...
(NB, It's all very well to say it's an html thing, nothing to do with Flare, but Flare was built to work with html, so it should have some mechanism to solve this problem.... just saying.)
Joanna
robdocsmith
Sr. Propeller Head
Posts: 265
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Can't Adjust Column Width in Table

Post by robdocsmith »

I don't know of a single piece of software that doesn't have quirks and little gotchas in it (including software I've written for myself for my own use!!!). Largely Flare does a pretty awesome job at what it does. For me it's a little too tied to the .NET Framework-y way of doing things and yes, HTML can be a pig sometimes. Mostly there are workarounds to the tough issues. Some things you just have to accept. I'm a PDF output kind of guy and there are definitely issues with text flow control through the document that you just have to let go of (things that Pagemaker, Framemaker, Quark did and do very well - but then they had/have other major issues for technical writing).

When inserting an image in your table, select the image name and then change the size in the Insert Image dialog to something minimally small that is guaranteed not to break the table. Then expand it once it's there.

Or slip into the Text Editor and add the image directly in the code (with appropriate sizing already specified - style="width:something;height:something;"). Or just copy/paste the IMG code from something that doesn't break the table and then change the name of the file.

Or create an IMG Class for tables that includes a size, if the tables are set dimensions in your documents and you do this often - would help all images appear consistent across your documents.

Or create a snippet of an image to be inserted in a table with sizes specified, insert it and then unsnippetize it and change the image filename.

Or copy the table column settings from the text editor and dump them in a text file somewhere so when things go haywire you can paste them back in.

Or if you use a specific style of table a lot, create a table style with fixed column widths.

That's one of things I do love about Flare. Generally there are many ways to achieve similar results, that are often better and easier than what you first thought of!

Rob
Post Reply