A2025 - feature added from elx-rml-runtime_3-8.0.12.jar
Understanding HTML2 Callback Width Handling
Introduction
In the HTML2 callback of our platform, column widths in tables are handled in a unique way. This guide explains how width settings are interpreted, the Behavioral Characteristics, and the best practices for achieving consistent column layouts.
How HTML2 Handles Column Widths
• The HTML2 callback only supports column widths specified directly within elements using the width attribute.
• Supported formats:
• Absolute width: <td width="10">
(numeric value)
• Percentage width: <td width="10%">
(percent value)
Important Behavior
• Style Attributes Ignored: Any width settings specified using CSS styles in (e.g., style=“width: 10px;”) are ignored.
• Width Values Treated as Ratios: All width values, whether numeric or percentage, are treated as ratios.
• Example: If you define columns with <td width="10">
, <td width="20">
, and <td width="30">
, the table will automatically treat these as 1:2:3 ratio.
• Even if you specify widths as percentages (10%, 20%, 30%), the percentage sign is discarded, and the values are still interpreted as ratios.
Example Scenarios
- Equal Distribution:
<table>
<tr>
<td width=20%>Column 1</td>
<td width=20%>Column 2</td>
<td width=20%>Column 3</td>
</tr>
</table>
• All three columns will be evenly distributed, despite the numeric values.
- Proportional Distribution:
<table>
<tr>
<td width="10">Column 1</td>
<td width="20">Column 2</td>
<td width="30">Column 3</td>
</tr>
</table>
• Columns will be distributed in a 1:2:3 ratio, filling the full table width.
Best Practices
• Use numeric values in the width attribute for clear ratio control.
• Avoid using style=“width:…” within elements, as these will be ignored.
• Always test table layouts in your HTML2 environment to ensure desired results.
Troubleshooting
• If column widths are not displaying as expected, ensure you are using the width attribute directly in , not in CSS styles.
• Remember that widths are always interpreted as proportional values.
Conclusion
Understanding the ratio-based approach of the HTML2 callback width handling is key to achieving consistent and predictable table layouts. Apply the best practices above to maintain control over your table designs.