SetStructElemRowSpan

Tagged PDF, Accessibility

Description

Sets the /RowSpan attribute (Table attribute owner) on the structure element currently open on the tag stack. The value indicates how many rows the current table cell spans. Equivalent to calling AddTagAttribute with Owner=Table, Name=RowSpan, and the integer value as a string.

Syntax

Delphi

function TPDFlib.SetStructElemRowSpan(RowSpan: Integer): Integer;

ActiveX

Function PDFlib::SetStructElemRowSpan(RowSpan As Long) As Long

DLL

int DLSetStructElemRowSpan(int InstanceID, int RowSpan);

Parameters

RowSpanThe number of rows the current table cell spans. Must be a positive integer. A value of 1 means the cell occupies exactly one row (default behaviour when no RowSpan is set). Values greater than 1 indicate a cell that spans multiple rows.

Return value

Returns 1 on success. Returns 0 if no document is open or no tag is currently open on the tag stack.

Remarks

Call this function after BeginTag (with tag type TH or TD) and before EndTag. The /RowSpan attribute is defined in ISO 32000-1 §14.8.5.7.2 (Table attribute owner, Table 337).

Row-spanning cells appear in tables where a header or data cell needs to stretch vertically across multiple rows — for example, a row header shared by several data rows. Providing the /RowSpan attribute lets assistive technology correctly build the logical grid model of the table.

When a cell also spans multiple columns, use SetStructElemColSpan in combination with this function.

Example

// A row header cell spanning two data rows
PDFlib.BeginTag('TH', 'First Quarter', '', '');
PDFlib.SetStructElemScope('Row');
PDFlib.SetStructElemRowSpan(2);
PDFlib.DrawText('First Quarter', 72, 680);
PDFlib.EndTag;

See also

SetStructElemColSpan, SetStructElemScope, AddTagAttribute, BeginTag, EndTag