[AccessD] HTML Align
Stuart McLachlan
stuart at lexacorp.com.pg
Sat Jul 23 13:40:05 CDT 2022
align is an attribute not a tag.
It needs to be inside a tag such as a div, table cell etc.
Use
<div align="center'>......</div>
around the line(s) you want centered.
On 23 Jul 2022 at 9:48, John Colby wrote:
> I am attempting to get my HTML Formatter to do alignment tags. It
> ain't werkin. Of course I'm ignorant of HTML in general so that isn't
> surprising. Can it be as simple as I thought and/or can anyone help
> me get it done?
>
> I'm essentially trying to directly encase the string to be formatted
> with something like
>
> mstrFormatted = "<align=" & strInteriorQuotes & "center" &
> strInteriorQuotes & ">" & mstrFormatted & "</align>"
>
> What I get displayed is:
>
> <align="left">Subscribed : False</align>
> Where the string includes the tags at either end instead of the tags
> being interpreted and performing the align.
>
> The full function is as follows:
>
> Function FormatString()
> mstrFormatted = mstrToFormat
> Const strInteriorQuotes As String = """"
> If mintStatus > 0 Then
> mstrFormatted = "<Font Color=" & strInteriorQuotes &
> HTMLColour(mintStatus) & strInteriorQuotes & ">" & mstrFormatted
> mstrFormattedClosingFontTag = mstrFormattedClosingFontTag &
> "</Font>"
> Else
> mstrFormatted = "<Font Color=" & strInteriorQuotes & mstrColor
> &
> strInteriorQuotes & ">" & mstrFormatted
> mstrFormattedClosingFontTag = mstrFormattedClosingFontTag &
> "</Font>"
> End If
> '
> 'Get the three font pieces grouped
> '
> Dim mstrFormattedClosingFontTag As String
> '
> If mstrFace <> "" Then
> mstrFormatted = "<Font Face=" & strInteriorQuotes & mstrFace &
> strInteriorQuotes & ">" & mstrFormatted
> mstrFormattedClosingFontTag = mstrFormattedClosingFontTag &
> "</Font>"
> End If
> If mintSize <> -1 Then
> mstrFormatted = "<Font Size=" & CStr(mintSize) & ">" &
> mstrFormatted mstrFormattedClosingFontTag =
> mstrFormattedClosingFontTag &
> "</Font>"
> End If
> mstrFormatted = mstrFormatted & mstrFormattedClosingFontTag
> If mblnBold Then
> mstrFormatted = "<b>" & mstrFormatted & "</b>"
> End If
> If mblnItalics Then
> mstrFormatted = "<i>" & mstrFormatted & "</i>"
> End If
> If mblnUnderline Then
> mstrFormatted = "<u>" & mstrFormatted & "</u>"
> End If
> Select Case mintAlign
> Case enumAlign.eCenter
> mstrFormatted = "<align=" & strInteriorQuotes & "center" &
> strInteriorQuotes & ">" & mstrFormatted & "</align>"
> Case enumAlign.eLeft
> mstrFormatted = "<align=" & strInteriorQuotes & "left" &
> strInteriorQuotes & ">" & mstrFormatted & "</align>"
> Case enumAlign.eRight
> mstrFormatted = "<align=" & strInteriorQuotes & "right" &
> strInteriorQuotes & ">" & mstrFormatted & "</align>"
> End Select
> If mblnCRLF Then
> mstrFormatted = mstrFormatted & "<br>"
> End If
>
> End Function
>
> --
> John W. Colby
> Colby Consulting
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list