Background colors for individual table cells

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Background colors for individual table cells

Unread postby Rainer Oehry » Mon Sep 03, 2018 5:35 pm

Hi Tim,

I would like to apply an individual background color to specific table cells.

Just using the text background color functionality does not work because it only applies this background color to whereever there is text, not to the cell as a whole.

Currently I overcome this problem by creating a single-cell table inside the main table and applying a background color to this table (and the entering the text in this inner table). The problem here is the cell padding in the main table: The inner table does not fill the whole cell of the main table, there is a border around it in the color of the main table background. As long as this is white, it's not perfect, but accepptable. But now I have a main table with a colored background where I would like to apply a different background color to specific cells, and my "table within table" solution does not look nice with this differently colored border around my inner table. Of course I could reduce the cell padding to zero, but this looks awful just everywhere else.

Is there a better solution?
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm

Re: Background colors for individual table cells

Unread postby Simon_Dismore » Tue Sep 04, 2018 12:40 am

Rainer Oehry wrote:I would like to apply an individual background color to specific table cells. Just using the text background color functionality does not work because it only applies this background color to whereever there is text, not to the cell as a whole.

Tim might have a better suggestion, but you can apply a color to a table cell like this:
  1. Click inside the cell to select it. You don't have to select specific text, I did it in the example below just for clarity.
  2. Right-click to bring up the context menu.
  3. Select Table > Properties
  4. In the Edit Table Properties dialog, click the Selected Cells tab
  5. Now set the Background color.
Here's an example:
Set-background-color-per-table-cell.png

If you are using the professional edition of H&M, you can create the same effect by setting the style explicitly in XML, e.g.
Code: Select all
<tr style="vertical-align:middle"><td style=" width:128px; background-color:#e0ffff; border-width:1px; border-color:#ffffff; border-style:solid;">...

The XML approach is good if you are trying to import a lot of data from an external source like Excel where you can pre-format it before pasting it into H&M, like the banded even and odd rows in my example.
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
Simon_Dismore
 
Posts: 49
Joined: Thu Jul 13, 2017 2:57 pm

Re: Background colors for individual table cells

Unread postby Tim Green » Tue Sep 04, 2018 6:04 am

Nothing to add to Simon's suggestion here. The Selected Cells tab in the Properties dialog is the only "way in" for this in the UI. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 20160
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Background colors for individual table cells

Unread postby Rainer Oehry » Tue Sep 04, 2018 10:19 am

Thank you Simon and Tim,

I was aware of this option, but it didn't seem like an easy solution for my problem, but only because I was thinking in a to complicated way.

I slightly oversimplified my situation, because part of the cell content are snippets. I had the snippet defined as a single-cell table and given it a background color, and then used it in the main table cell with the same background color. Now I have the situation that I need the same snippet in main table cells with a different background color, and it seemed overly complicated to create the same snippet again, just with a different background color.

Your suggestion made me think it over again, and the probably easiest way for me is to embed the snippet NOT as its own paragraph. The formatting within the snippet (even paragraph breaks with indivual "space before and after" setting) is maintained (I was in fact not aware that a snippet that is embedded "inline" can itself contain several paragraphs), and the text is displayed in the main table cell respecting the cell’s background color.

The only disadvantage that I can see so far (and the reason why I usually embed snippets as their own paragraph) is that for snippets that are embedded "inline", only an abbreviated first line of the content is displayed, so it is not possible to verify the final "look" of the entire cell without publishing the topic.

Would it be difficult to offer the option to fully display "inline" snippets too in the editor?

Anyway, thank you again for your most valuable support.
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm

Re: Background colors for individual table cells

Unread postby Tim Green » Tue Sep 04, 2018 11:46 am

Hi Rainer,

Would it be difficult to offer the option to fully display "inline" snippets too in the editor?

That's problematic because they could contain a lot of text and the block they're displayed in can't "flow" to show them inline as part of the paragraph. Large inline snippets would then be shown in an annoying large block on the page, even in the middle of a paragraph. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 20160
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Background colors for individual table cells

Unread postby Rainer Oehry » Tue Sep 04, 2018 2:28 pm

Hi Tim,

That's problematic because they could contain a lot of text and the block they're displayed in can't "flow" to show them inline as part of the paragraph.


Yes, I get this so far. It would be nice, though, to have exactly this option — to see the inline snippet content fully expanded, "flowing" in the editor. The same could apply to variables, where it would be nice to have an option to see not the name, but the content of the variable continuously inserted in the surrounding text. Something like the functionality in Excel where you can toggle between displaying the formula and the resulting numbers in a spreadsheet …

But this would probably not be easy to program, so I will not make it my top priority on my wish list :)
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm

Re: Background colors for individual table cells

Unread postby Simon_Dismore » Tue Sep 04, 2018 3:14 pm

Rainer Oehry wrote:It would be nice to see the inline snippet content fully expanded, "flowing" in the editor.

In effect, you would like to be able to toggle back-and-forth between the 'Snippet is linked' and 'Copy & Paste into text' states, but with the expanded text being read-only, which isn't how copy & paste works right now. There would have to be some third state for the preview.

I wonder how often you would need it. Of course you can preview by manually selecting 'Copy & Paste into text' and then using <Ctrl>-Z to undo it immediately afterwards.
Simon_Dismore
 
Posts: 49
Joined: Thu Jul 13, 2017 2:57 pm

Re: Background colors for individual table cells

Unread postby Rainer Oehry » Tue Sep 04, 2018 3:34 pm

Of course you can preview by manually selecting 'Copy & Paste into text' and then using <Ctrl>-Z to undo it immediately afterwards.


Just tried it — works very nicely, and does not need many clicks: doubleclick the inline snippet, select Copy and Paste, click OK, and then afterwards <Ctrl>-Z to undo it.

Thanks for this tip, I had not thought of that yet!
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm

Re: Background colors for individual table cells

Unread postby Tim Green » Tue Sep 04, 2018 4:06 pm

Rainer Oehry wrote:Just tried it — works very nicely, and does not need many clicks: doubleclick the inline snippet, select Copy and Paste, click OK, and then afterwards <Ctrl>-Z to undo it.

Do you know that you can also see the contents of the snippet just by holding the mouse pointer over the snippet for a second or two? This will work if you have mouseover information active in View > Program Options > General. It won't show how the contents of the snippet will look inside the current paragraph, of course, but you will see the text of the contents.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 20160
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Background colors for individual table cells

Unread postby Rainer Oehry » Wed Sep 05, 2018 8:39 am

Thank you, Tim,

yes, I am aware of this hover functionality, and I use it for snippets and for variables, too.

By the way: Why does the popup disappear after approximately 5 seconds? For longer snippets or variables, I have to re-hover several times to be able to verify the whole content … why can’t it stay visible until I move the mouse pointer out of the snippet or the variable?

Not a big issue, though …
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm

Re: Background colors for individual table cells

Unread postby Tim Green » Wed Sep 05, 2018 5:49 pm

Rainer Oehry wrote:By the way: Why does the popup disappear after approximately 5 seconds?

That was a request from many users who didn't want them to be displayed longer... :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 20160
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Background colors for individual table cells

Unread postby Rainer Oehry » Thu Sep 06, 2018 9:32 am

They just need to move the mouse slightly out of the hover area, and the popup disappears immediately. And their "mouse hand" is already on the mouse, otherwise it would not have been possible to hover in the first place. The popup also disappears immediately when a key on the keyboard is pressed. Doesn’t seem unreasonable to me …

Other solutions might be:
    Give the user the chance to move the cursor into the popup (actually this is not possible because of the gap between hover area and popup, and the popup is gone before the mouse can reach it) and keep the popup open as long as the cursor is kept whithin the popup

    Do not close the popup while the user is moving the mouse slightly back and forth within the hover area (each moving event within the hover area could be interpreted as new hover event which starts a new 5 second (or whatever timeframe) timer for the popup

    Make this a configuration setting: "Close hover popups after this number of seconds:" (then I can input 99, or "0 means forever"), or "Keep popups visible as long as the mouse pointer is in the hover area?"

I know I like to bitch about all these little time-optimizing UI details, but having to do something avoidable over and over again — like hovering several times over the same variable to be able to fully read it — a thousand times a day will unnecessarily cost the user half an hour every day, even if it takes less than two seconds each time …
Regards,

Rainer
Head of Technical Writing
TIG Technische Informationsgesellschaft, Rankweil, Austria
Rainer Oehry
 
Posts: 43
Joined: Sun Dec 10, 2017 12:47 pm


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: tatiana, Vanitha R and 7 guests