Skip to content

Tabs not working in titles (Edit: actually not really working at all anywhere) #862

Open
@judgej

Description

@judgej

Setting a tab in a paragraph works fine:

$section->addText("First\tSecond\tThird", [], 'paragraphStyleWithTabs');

The First/Second/Third words get correctly positioned at the tab stops defined in the paragraph style.

When creating a title, this does not seem to work:

    $phpWord->addTitleStyle(
        3,
        [],
        ['tabs' => [new \PhpOffice\PhpWord\Style\Tab('left', 1600), ...]]
    );

    $section->addTitle("First\tSecond\tThird", 3);

The resulting DOCX document puts a space into the position where the tab should be.

However, the tab stops are correctly added to the ruler in the title, so manually replacing the space with a tab inside MS Word takes the title text to the correct tab positions. The tabs are getting in there, are supported by MS Word, but the title text is not getting its "\t" tab characters handled as text tabs in the generated document.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions