How do I prevent words from breaking in table cells?

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
chuck_agari
Sr. Propeller Head
Posts: 225
Joined: Wed May 30, 2018 2:40 pm

How do I prevent words from breaking in table cells?

Post by chuck_agari »

I'm seeing this:
force-broken_words.png
I have no code anywhere that defines the width of a table column. The start of my table code is just this:

Code: Select all

<table class="agari_settings">
            <col />
            <col />
            <thead>
                <tr>
                    <th>Setting</th>
                    <th>Description</th>
                </tr>
            </thead>
Nothing in the class definitions defines any width, and I added this based on something I found elsewhere:

Code: Select all

word-break: keep-all !important;
So I have this definition:

Code: Select all

table.agari_settings td,
	table.agari_settings th
	{
		border: 1px solid #AAAAAA;
		padding: 0.05in;
		hyphens: none;
		mc-hyphenate: never;
		word-break: keep-all !important;
	}
This happens to be in a 2-column table. There are no graphics or other entities in any of the right-column cells that are wide enough to force the left column to be so narrow that this word breaking occurs.

Any ideas?
You do not have the required permissions to view the files attached to this post.
SteveS
Senior Propellus Maximus
Posts: 2089
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: How do I prevent words from breaking in table cells?

Post by SteveS »

I don't have access to Flare at the minute, so I'm going off my (becoming more and more unreliable) memory...

If you select the table in the editor you should see a representation at the top of table width properties. This will tell you if someone has explicitly set the column width. Try to set it to auto, or similar, and see what happens.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
chuck_agari
Sr. Propeller Head
Posts: 225
Joined: Wed May 30, 2018 2:40 pm

Re: How do I prevent words from breaking in table cells?

Post by chuck_agari »

SteveS wrote:I don't have access to Flare at the minute, so I'm going off my (becoming more and more unreliable) memory...

If you select the table in the editor you should see a representation at the top of table width properties. This will tell you if someone has explicitly set the column width. Try to set it to auto, or similar, and see what happens.
I am the only author.

Because I have not explicitly set any width values, the table and column values both show implicitly as auto.
SteveS
Senior Propellus Maximus
Posts: 2089
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: How do I prevent words from breaking in table cells?

Post by SteveS »

Damn. Hoping for a quick fix.

Have you tried setting word-break to normal? W3 schools seem to link keep-all with Chinese/ Japenese/ Korean, so it might be having a funky effect.

I'd also try removing the <col /> tags.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: How do I prevent words from breaking in table cells?

Post by ChoccieMuffin »

What is your output? Or is the screenshot from the XML Editor?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
chuck_agari
Sr. Propeller Head
Posts: 225
Joined: Wed May 30, 2018 2:40 pm

Re: How do I prevent words from breaking in table cells?

Post by chuck_agari »

ChoccieMuffin wrote:What is your output? Or is the screenshot from the XML Editor?
The screen shot is from the PDF.
chuck_agari
Sr. Propeller Head
Posts: 225
Joined: Wed May 30, 2018 2:40 pm

Re: How do I prevent words from breaking in table cells?

Post by chuck_agari »

SteveS wrote:Damn. Hoping for a quick fix.

Have you tried setting word-break to normal? W3 schools seem to link keep-all with Chinese/ Japenese/ Korean, so it might be having a funky effect.

I'd also try removing the <col /> tags.
I'll try tweaking the CSS that way and see what happens, although the behavior was the same without that property. at all.

I'm curious to know why you think removing the col tags would have an effect. Flare adds them automatically when it creates a table.
chuck_agari
Sr. Propeller Head
Posts: 225
Joined: Wed May 30, 2018 2:40 pm

Re: How do I prevent words from breaking in table cells?

Post by chuck_agari »

Removing the col tags did not work.

Changing the value of to both normal and nowrap did not work.

Using the overflow-wrap properly and its value of normal did not work.
SteveS
Senior Propellus Maximus
Posts: 2089
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: How do I prevent words from breaking in table cells?

Post by SteveS »

chuck_agari wrote:...I'm curious to know why you think removing the col tags would have an effect. Flare adds them automatically when it creates a table.
I don't. But when things don't act as expected and I see something like that (which in this case relates to a design element you are having trouble with) I'll try and rule it out as a contributing factor.

My next step in diagnosing would be to create a new two-column table and seeing if it does the same thing...
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
DavidJGross
Propeller Head
Posts: 17
Joined: Thu Mar 12, 2020 6:54 am

Re: How do I prevent words from breaking in table cells?

Post by DavidJGross »

Has there been any resolution to this? I'm having a similar issue and would love to hear how/if you figured it out.
robdocsmith
Sr. Propeller Head
Posts: 248
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: How do I prevent words from breaking in table cells?

Post by robdocsmith »

I've had issues with columns needlessly squashing themselves even when no width is set in the <col> tags or stylesheet or tablestyle. It seems that auto width doesn't necessarily always mean adjust to the text inside. What sometimes works for me is to add a column to the table. It seems to force Flare to reassess the column widths and can fix squashed columns. Then deleting the new column keeps the new settings. Don't ask me why or how... It's particularly a problem for me when the table has a lot of columns (>6 or so).

Might be worth a try encapsulating problematic cell text in a <p></p> tag. This seems to resolve a few issues with tables and alignment and might help Flare decide to hyphenate or not.

Explicit column widths will work if you can't get around it, either setting locally in the <col> tag, or if it's a common issue with several similar tables, globally in the stylesheet, or globally in the table style.

Rob
Post Reply