NAME

Markdown::Parser::TableCell - Markdown Table Cell Element

SYNOPSIS

my $o = Markdown::Parser::TableCell->new;
$o->add_element( $o->create_text( @_ ) );

VERSION

v0.3.0

DESCRIPTION

This is a class object to represent a table cell. It is used by Markdown::Parser and inherits from Markdown::Parser::Element

METHODS

align

Sets or get the alignment of the cell content. Valid values are left, center or right

as_css_grid

Returns this table cell as a CSS grid as a regular string.

This is quite a nifty feature that enables you to transform effortlessly a table into a CSS grid.

See "as_css_grid" in Markdown::Parser::Table

as_markdown

Returns a string representation of the table cell formatted in markdown.

It returns a plain string.

as_pod

Returns a string representation of the table cell formatted in pod.

It returns a plain string.

as_string

Returns an html representation of the table cell. It calls each of its children to get their respective html representation.

It returns a plain string.

class

Sets or gets the class attribute for this table cell.

colspan

Provided with an integer greater than 0 and this sets the number of column this cell spans. Default should be 1.

Value is stored as Module::Generic::Number object.

It returns the current value set, which is a Module::Generic::Number object.

formatted_lines

This returns a Module::Generic::Array object representing the lines of data properly formatted for this cell.

This method is only used for "as_markdown" method.

width

Sets or gets the width of the cell as an integer. The value is stored as a Module::Generic::Number object and it represents the number of characters, not the number of pixels. There are 8 pixels per character.

It is important that this value be set, or else, "formatted_lines" would not know how to align the cells content.

This method is also accessed by "as_markdown" in Markdown::Parser::TableRow

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT & LICENSE

Copyright (c) 2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.