I have a table which needs multiple column headings e.g. a name for each column, then a group name for the first 4 columns, another for the next 3 columns etc. I can’t find a way to do this with the standard table.
I reckon I could work around this if it was possible to hide the table column headings and then draw my own headings - as the user would be unable to alter the width or order of the columns this should look OK.
Is it possible to hide the table column headings? On a related note, is it possible to display the column headings but stop the user resizing them?
The easiest thing to do would be to put opaque labels on top of the headers, and put a mouse event handler that did:
event.consume()
on the labels so that the mouse events don’t get to the table.
I tried something similar with an opaque rectangle, but I found that it was impossible to completely cover the headings in a way which worked when the user resized the window. Some part of the headings ended up showing to one side of the rectangle.
Al,
A couple of thoughts that might give you some ideas:
- Can you give the columns names consisting of spaces only?
- Can you change the header text foreground color to match the background?
Well, I’ve come up with a workaround, thanks to the ideas posted. I achieved this using the following steps:
-
Make the table column heading tall enough to accept the proposed text. I used the Table Customizer to enter<html><p><p><p><p>
into the ‘Header’ field of the first column. Just change the number of new paragraphs to alter the height produced.
-
Blank out the headings in the other columns by entering a single space in the ‘Header’ field for each column.
-
Manually set the column widths by putting a line for each column in the window ‘internalframeActivated’ script e.g.table = fpmi.gui.getParentWindow(event).getComponentForPath('Root Container.tblContents')
table.setColumnWidth(0, 200)
table.setColumnWidth(1, 150)
etc.
-
Manually place column headings using label components with non-opaque backgrounds.
-
Paste a transparent rectangle (with its edge widths set to 0) over the whole header, with its ‘mouseClicked’ event set to event.consume()
This fulfils all the criteria of multi-line headers with fixed column widths that the user cannot alter.
If anyone can think of a better approach, please let me know!