Writing Rich Text Entries#

The content of a TextEntry is HTML.

Create a Rich Text Entry#

The examples below assume you already have a page object:

from labapi import TextEntry

page.entries.create(TextEntry, "<p>This is a rich text entry.</p>")

For a broader HTML reference, see the MDN HTML elements reference.

Common HTML Patterns#

Paragraphs#

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Text Formatting#

<p>
    This paragraph contains <b>bold</b>,
    <i>italic</i>,
    <u>underlined</u>,
    and <s>strikethrough</s> text.
</p>

Text Color#

<p style="color:red;">This text is red.</p>
<p style="color:#0000ff;">This text is blue.</p>

Tables#

<table border="1">
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
    </tr>
    <tr>
        <td>Row 1, Cell 1</td>
        <td>Row 1, Cell 2</td>
    </tr>
    <tr>
        <td>Row 2, Cell 1</td>
        <td>Row 2, Cell 2</td>
    </tr>
</table>

Lists#

<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>
<ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
</ol>