Vertical alignment of a cell with HTML

Dear support team,
I'm using, on some cells, HTML syntax to change colors, bold, and so on in part of the shown cell text, but the resulting text is always vertically aligned on TOP.
Grid has WordWrap set to False.

In the GetAlignment event any cell alignment is set:
procedure TWorkOrderManagementFrame.WorkOrdersGridGetAlignment(Sender: TObject; ARow, ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment);
begin
HAlign := taLeftJustify;
VAlign := tvaCenter;
end;

procedure TWorkOrderManagementFrame.WorkOrdersGridGetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: string);
....
WOCN_DLDT:
begin
if Data.DeadlineDateTime.AsInt64 = 0 then
Value := _('UNSET')
else
begin
S := Data.DeadlineDateTime.GetAsString('dd/mm/yyyy', ' hh:nn');
Hours := HoursBetween(Now, Data.DeadlineDateTime.GetAsDateTime);
if Hours > 24 then
Value := S
else if Hours > 0 then
Value := '' + S + '' // html format but removed posting it
else
Value := '' + S + '' // html format but removed posting it
end;
end;
...

Thank you in advance for any suggestion.
Best Regards

HTML formatted text is using the alignment specifiers from the HTML itself, not what is set via OnGetAlignment()

I know there is a tag to align horizontally.
There is also a tag to align vertically the HTML text on a Cell ?

At this moment, mini HTML can do horiz. alignment via P tag with align attribute but there is no vertical alignment control.
https://www.tmssoftware.com/site/minihtml.asp

1 Like