How To Align A Heading Or Footing Element In An HTML Or PDF Report

How to:

  • Align a Heading or Footing Element in an HTML or PDF Report

For HTML output (and for Excel 2000 output, which uses HTML alignment), you can position text and field items in headings and footings using HEADALIGN options. These options work within the limitations of HTML and browser technologies to provide a significant degree of formatting flexibility. Here is how HEADALIGN works.

For PDF output, you can use the HEADALIGN=BODY option to align heading and footing elements with the report body.

For HTML or Excel 2000 output, when HEADALIGN is set either to BODY or INTERNAL, output is laid out as an HTML table, which means that the browser determines the widths of the columns, thereby limiting the precise positioning of items. A basic rule governs the placement of heading or footing items: each item (text or embedded field) is placed in sequence into the next HTML table cell (<TD>). When HEADALIGN is set to NONE, the default, all the items in the heading or footing are strung together, inside a single cell. The browser stretches the heading table and the report table to accommodate the length of the text.

You can exercise control over the placement of items by overriding the default and choosing either BODY or INTERNAL:

  • HEADALIGN=BODY puts heading item cells in the same HTML table (for HTML or EXL2K output) as the body of the report, ensuring that the items in the heading and the data in the body of the report line up naturally since they have the same column widths. For PDF output, HEADALIGN=BODY aligns heading items with data columns. This is a simple and useful way to align heading items with columns of data. For example, suppose that you have computed subtotal values that you want to include in a sort footing. Using HEADALIGN=BODY, you can align the subtotals in the same columns as the data that is being totaled.
  • HEADALIGN=INTERNAL puts the heading items in an HTML table of its own. This allows the heading items to be aligned vertically with each other, independent of the data, since the widths of the heading items do not affect the width of the report columns and vice versa.
  • In EXL2K formatted reports, with headings or footings containing multiple items that are separated by spot markers without spaces, the spot marker adds an additional space between the items within the text in the cell. The workaround is to use XLSX formatted reports, instead.

To compare sample output, see Comparing Output Generated With HEADALIGN Options.

To break a text string into multiple parts for manipulation across columns, you can use <+0> spot markers in the request. For details, see Identifying a Report Component in a WebFOCUS StyleSheet.

You can use HEADALIGN options in conjunction with the COLSPAN attribute. COLSPAN allows heading items to span multiple table columns, thereby providing additional flexibility in how you can design your headings. For details, see Aligning a Heading or Footing Element Across Columns in an HTML or PDF Report.

If there is more than one heading or footing type in a report, you can individually align any element within each of them using this syntax.

Tip: For a summary of other alignment methods, see Choosing an Alignment Method for Heading and Footing Elements.

Từ khóa » Html Colspan Align Right