Skip to content

Inline bordered text in table cell #2825

@KalJopeachX

Description

@KalJopeachX

I want to create a table cell with three lines of mixed content:

  1. The first line: a name (e.g., "TESTNAME").
  2. The second line: "SOMETEXT" with a border around it, followed by a space and a date (e.g., "12/09/2025") on the same line, with the date not framed by borders.
  3. The third line: a comment (e.g., "TESTЕST...").

The layout should have zero spacing between the three lines (as shown in the attached picture), with only "SOMETEXT" bordered and a single space separating it from the date.

Current Behavior:
Using addTextRun, I’m unable to keep "SOMETEXT" and the date on the same line with a border only around "SOMETEXT".

Image

Environment:

  1. PHPWord version: 1.1.0
  2. PHP version: 7.2.34

If anyone knows how to achieve this, please help! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions