SetStructElemColSpan

Структурированный PDF, Доступность

Описание

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

Синтаксис

Delphi

Function TPDFlib.SetStructElemColSpan(ColSpan: Integer): Integer;

ActiveX

Function PDFlib::SetStructElemColSpan(ColSpan As Long) As Long

DLL

int DLSetStructElemColSpan(int InstanceID, int ColSpan);

Параметры

ColSpanНа сколько столбцов распространяется текущая ячейка таблицы; положительное целое. 1 — ячейка занимает ровно один столбец (поведение по умолчанию без ColSpan); значения больше 1 — растянутая ячейка заголовка или данных

Возвращаемое значение

Возвращает 1 в случае успеха, 0 — если документ не открыт или на стеке тегов нет открытого тега

Примечания

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

Spanning cells are common in complex tables — for example, a column header that spans two data columns. Providing the /ColSpan attribute allows assistive technology to correctly compute cell positions and associate headers with data cells across the entire table grid.

When a cell also spans multiple rows, use SetStructElemRowSpan in combination with this function.

Пример

// A header cell spanning two columns
PDFlib.BeginTag('TH', 'Q1 and Q2 Revenue', '', '');
PDFlib.SetStructElemScope('Column');
PDFlib.SetStructElemColSpan(2);
PDFlib.DrawText('Q1 and Q2 Revenue', 100, 700);
PDFlib.EndTag;

См. также

SetStructElemRowSpan, SetStructElemScope, AddTagAttribute, BeginTag, EndTag