mPDF Manual – HTML control tags

dottab

(mPDF ≥ 4.3)

dottab – Insert dots to following (right-aligned) text

Description

<dottab [ $outdent ] />

Insert a string of dots to fill the space to the text which follows <dottab />, which is right-aligned. This gives the appearance seen in e.g. a table of contents, or a menu with prices. A minimum of 3 dots (with spaces either side) is inserted. If the text which follows the <dottab /> will not fit on a single line, the default tab of ' ... ' is added, and text is not right-aligned.

From mPDF 5.7+ CSS styles can be applied to <dottab> as for an inline element.

Attributes

$outdent

Takes any valid CSS LENGTH  e.g. "2em"

Default: '0'

Changelog

Version Description
4.3 This tag was added.
5.7 $outdent was added

Examples

Example #1

<?php

$menuitem = 'Chilli con carne <dottab />&amp;nbsp;£7.95';

$mpdf->WriteHTML($menuitem);

Example #2

<?php
// To right-align the text which follows the <dottab> whilst indenting any preceding lines:

$menuitem = 'Chilli con carne etc. etc. <dottab outdent="3em" />&amp;nbsp;£7.95';

Fork me on GitHub