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: 3667
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: 247
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: 247
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: 2087
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: 390
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: 811
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.
Post Reply