Focal Point
[CLOSED]Column Titles Aligned Top

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1297084186

March 28, 2016, 04:02 AM
Danny-SRL
[CLOSED]Column Titles Aligned Top
Report titles are vertically aligned bottom.
Is there any way to align them top (aside from an NFR)?

This message has been edited. Last edited by: <Emily McAllister>,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 28, 2016, 11:23 AM
CoolGuy
I know you can manipulate alignment with CSS, but the text-align attribute doesn't have a "top" option that I know of.

I've always just used CSS to either center the content or align it left or right. Never attempted to align it to the top of the td cell it sits in though. You could possibly play with the td padding-top and make that 0 to see if that helps. Or play with the vertical-align property.

Add an -HTMLFORM block to the end of your procedure, and then use whatever CSS works with your table structure:

-HTMLFORM BEGIN
<style>
add your CSS rules here...
</style>
-HTMLFORM END



8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
March 30, 2016, 03:39 PM
Danny-SRL
See the following fex:
  
TABLE FILE CAR
SUM 
     CAR.BODY.SALES AS 'Units,Sold'
BY  LOWEST CAR.ORIGIN.COUNTRY AS 'Country,of,Origin'
BY  LOWEST CAR.COMP.CAR AS 'Manufacturer'
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END

View Source shows for the field CAR AS 'Manufacturer'
  
<td style="vertical-align:bottom" class='x2'>
            <br>            <br>Manufacturer</td>

What I am looking for is to have instead:
  
<td style="vertical-align:top" class='??'>
Manufacturer</td>

I'm afraid this will have to be a NFR...


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 08, 2016, 10:34 AM
Tamra
quote:
TABLE FILE CAR
SUM
CAR.BODY.SALES AS 'Units,Sold'
BY LOWEST CAR.ORIGIN.COUNTRY AS 'Country,of,Origin'
BY LOWEST CAR.COMP.CAR AS 'Manufacturer'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END


Do you want to align the title 'Manufacturer' with the column title 'Country.....' ?
I tried the following:
AS 'Manufacturer, , ,'

Depending on where you want the title placed related to the other titles add/remove the comma.

Thank you for participating in the Focal Point Forum.

Kindest regards,
Tamra Colangelo
Focal Point Moderator - Information Builders Inc.
* Summit 2016 – June 13-17 in Reno, Nevada  - http://www.informationbuilders.com/events/summit


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
April 08, 2016, 12:16 PM
GavinL
Well, I pulled out every trick I know and failed on all account. Tamra's solution with comma's on the end looks to be the best, unless you want to write it all yourself as HTML, which is my standard way, that way I have full control over all code displayed.

This is what I would of done.. Little more code, but I have full control over everything in detail.



-DEFAULTH &COUNTRY = _FOC_NULL;
-DEFAULTH &CAR = _FOC_NULL;
-DEFAULTH &SALES = _FOC_NULL;

TABLE FILE CAR
SUM
	COMPUTE SALES/A25 = FPRINT(SALES, 'D12CM', 'A25V');
BY  LOWEST CAR.ORIGIN.COUNTRY
BY  LOWEST CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS MYTABLE
END

-HTMLFORM BEGIN
<html>
<head>
	<style>
	.table {display: table; border: 1px solid #c0c0c0;}
	.row {display: table-row;}
	.col {display: table-cell; border: 1px solid #c0c0c0; padding: 5px;}
	.head {vertical-text: top; text-align: center; font-weight: bold; background-color: #eee;}
	.data {vertical-text: top; text-align: left; white-space: nowrap;}
	.units {text-align: right!important;}
	</style>
</head>
<body>
<div class="table">
	<div class="row">
		<div class="col head">
			Country<br/>of<br/>Origin
		</div>
		<div class="col head">
			Manufacturer
		</div>
		<div class="col head">
			Units<br/>Sold
		</div>
	</div>
-REPEAT ENDLOOP &LINES TIMES
-READFILE MYTABLE

-SET &COUNTRY = TRUNCATE(&COUNTRY);
-SET &CAR = TRUNCATE(&CAR);
-SET &SALES = TRUNCATE(&SALES);

	<div class="row">
		<div class="col data">
			&COUNTRY
		</div>
		<div class="col data">
			&CAR
		</div>
		<div class="col data units">
			&SALES
		</div>
	</div>
-ENDLOOP
</body>
</html>
-HTMLFORM END




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
April 14, 2016, 10:02 AM
Danny-SRL
Tamra,
Yes, one could use commas. However, most of the code is generated dynamically so finding out how many commas to add to the TITLE is a bit hairy.

Gavin,
Thanks.
However 2 problems:
1. I ran your code and I didn't get the same output you show.
2. The customer is not an HTML enthusiast!

What one would need is a SET command, foe example:
SET TITLEPOS={BOTTOM, TOP}
where BOTTOM would be the DEFAULT.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 14, 2016, 10:18 AM
j.gross
Rather than yet another SET to control one specific element on an all-or-nothing basis, I'd prefer to have STYLE syntax to specify vertical positioning of "cell" content -- applicable wholesale or retail, to column-titles, data content, and maybe other contexts as well.

And include Middle along with Top and Bottom.
April 15, 2016, 04:27 AM
Danny-SRL
Jack,

Right on.
Is IBI listening?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 18, 2016, 09:33 AM
GavinL
quote:
Gavin,
Thanks.
However 2 problems:
1. I ran your code and I didn't get the same output you show.
2. The customer is not an HTML enthusiast!


Not knowing html would be a problem, but I'm not sure why your not getting the same results. I'm on 8.1.04, I doubt there is that much difference between it and 8.1.05. I tested with IE 11 and Chrome and got the same results.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server