| 1 | ##---------------------------------------------------------------------------- | ||
| 2 | ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableCol.pm | ||
| 3 | ## Version v0.2.0 | ||
| 4 | ## Copyright(c) 2022 DEGUEST Pte. Ltd. | ||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||
| 6 | ## Created 2022/01/08 | ||
| 7 | ## Modified 2022/09/18 | ||
| 8 | ## All rights reserved | ||
| 9 | ## | ||
| 10 | ## | ||
| 11 | ## This program is free software; you can redistribute it and/or modify it | ||
| 12 | ## under the same terms as Perl itself. | ||
| 13 | ##---------------------------------------------------------------------------- | ||
| 14 | package HTML::Object::DOM::Element::TableCol; | ||
| 15 | BEGIN | ||
| 16 | { | ||
| 17 | use strict; | ||
| 18 | use warnings; | ||
| 19 | warnings::register_categories( 'HTML::Object' ); | ||
| 20 | use parent qw( HTML::Object::DOM::Element ); | ||
| 21 | use vars qw( $VERSION ); | ||
| 22 | use HTML::Object::DOM::Element::Shared qw( :tablecol ); | ||
| 23 | our $VERSION = 'v0.2.0'; | ||
| 24 | }; | ||
| 25 | |||
| 26 | use strict; | ||
| 27 | use warnings; | ||
| 28 | |||
| 29 | sub init | ||
| 30 | { | ||
| 31 | my $self = shift( @_ ); | ||
| 32 | # Can either be col or colgroup | ||
| 33 | $self->{tag} = 'colgroup' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) ); | ||
| 34 | $self->{_init_strict_use_sub} = 1; | ||
| 35 | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||
| 36 | return( $self ); | ||
| 37 | } | ||
| 38 | |||
| 39 | # Note: deprecated property align is inherited | ||
| 40 | |||
| 41 | # Note: deprecated property ch | ||
| 42 | sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); } | ||
| 43 | |||
| 44 | # Note: deprecated property chOff | ||
| 45 | sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); } | ||
| 46 | |||
| 47 | sub choff : lvalue { return( shift->chOff( @_ ) ); } | ||
| 48 | |||
| 49 | # Note: property span | ||
| 50 | sub span : lvalue { return( shift->_set_get_property( 'span', @_ ) ); } | ||
| 51 | |||
| 52 | # Note: deprecated property vAlign | ||
| 53 | sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); } | ||
| 54 | |||
| 55 | sub valign : lvalue { return( shift->vAlign( @_ ) ); } | ||
| 56 | |||
| 57 | # Note: deprecated property width is inherited | ||
| 58 | |||
| 59 | 1; | ||
| 60 | # NOTE: POD | ||
| 61 | __END__ | ||
| 62 | |||
| 63 | =encoding utf-8 | ||
| 64 | |||
| 65 | =head1 NAME | ||
| 66 | |||
| 67 | HTML::Object::DOM::Element::TableCol - HTML Object DOM TableCol Class | ||
| 68 | |||
| 69 | =head1 SYNOPSIS | ||
| 70 | |||
| 71 | use HTML::Object::DOM::Element::TableCol; | ||
| 72 | my $col = HTML::Object::DOM::Element::TableCol->new || | ||
| 73 | die( HTML::Object::DOM::Element::TableCol->error, "\n" ); | ||
| 74 | |||
| 75 | =head1 VERSION | ||
| 76 | |||
| 77 | v0.2.0 | ||
| 78 | |||
| 79 | =head1 DESCRIPTION | ||
| 80 | |||
| 81 | This interface provides special properties (beyond the L<HTML::Object::DOM::Element> interface it also has available to it inheritance) for manipulating single or grouped table column elements using the C<colgroup> or C<col> HTML tag. | ||
| 82 | |||
| 83 | The <colgroup> HTML element defines a group of columns within a table. The <col> HTML element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element. | ||
| 84 | |||
| 85 | <table> | ||
| 86 | <colgroup span="4">Countries information</colgroup> | ||
| 87 | <col> | ||
| 88 | <col class="economic"> | ||
| 89 | <col span="2" class="people"> | ||
| 90 | </colgroup> | ||
| 91 | <tr> | ||
| 92 | <th>Countries</th> | ||
| 93 | <th>Capitals</th> | ||
| 94 | <th>Population</th> | ||
| 95 | <th>Language</th> | ||
| 96 | </tr> | ||
| 97 | <tr> | ||
| 98 | <td>Japan</td> | ||
| 99 | <td>Tokyo</td> | ||
| 100 | <td>126 million</td> | ||
| 101 | <td>Japanese</td> | ||
| 102 | </tr> | ||
| 103 | <tr> | ||
| 104 | <td>Taiwan</td> | ||
| 105 | <td>Taipei</td> | ||
| 106 | <td>23 million</td> | ||
| 107 | <td>Traditional Chinese</td> | ||
| 108 | </tr> | ||
| 109 | </table> | ||
| 110 | |||
| 111 | =head1 INHERITANCE | ||
| 112 | |||
| 113 | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+ | ||
| 114 | | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TableCol | | ||
| 115 | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+ | ||
| 116 | |||
| 117 | =head1 PROPERTIES | ||
| 118 | |||
| 119 | Inherits properties from its parent L<HTML::Object::DOM::Element> | ||
| 120 | |||
| 121 | =head2 span | ||
| 122 | |||
| 123 | Is an unsigned long that reflects the span HTML attribute, indicating the number of columns to apply this object's attributes to. Must be a positive integer. | ||
| 124 | |||
| 125 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/span> | ||
| 126 | |||
| 127 | =head1 METHODS | ||
| 128 | |||
| 129 | Inherits methods from its parent L<HTML::Object::DOM::Element> | ||
| 130 | |||
| 131 | =head1 DEPRECATED PROPERTIES | ||
| 132 | |||
| 133 | =head2 align | ||
| 134 | |||
| 135 | Is a string that indicates the horizontal alignment of the cell data in the column. | ||
| 136 | |||
| 137 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/align> | ||
| 138 | |||
| 139 | =head2 ch | ||
| 140 | |||
| 141 | Is a string representing the alignment character for cell data. | ||
| 142 | |||
| 143 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/ch> | ||
| 144 | |||
| 145 | =head2 chOff | ||
| 146 | |||
| 147 | Is a string representing the offset for the alignment character. | ||
| 148 | |||
| 149 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/chOff> | ||
| 150 | |||
| 151 | =head2 choff | ||
| 152 | |||
| 153 | Alias for L</chOff> | ||
| 154 | |||
| 155 | =head2 vAlign | ||
| 156 | |||
| 157 | Is a string that indicates the vertical alignment of the cell data in the column. | ||
| 158 | |||
| 159 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/vAlign> | ||
| 160 | |||
| 161 | =head2 valign | ||
| 162 | |||
| 163 | Alias for L</vAlign> | ||
| 164 | |||
| 165 | =head2 width | ||
| 166 | |||
| 167 | Is a string representing the default column width. | ||
| 168 | |||
| 169 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/width> | ||
| 170 | |||
| 171 | =head1 AUTHOR | ||
| 172 | |||
| 173 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||
| 174 | |||
| 175 | =head1 SEE ALSO | ||
| 176 | |||
| 177 | L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement>, L<Mozilla documentation on tablecol element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tablecol> | ||
| 178 | |||
| 179 | =head1 COPYRIGHT & LICENSE | ||
| 180 | |||
| 181 | Copyright(c) 2022 DEGUEST Pte. Ltd. | ||
| 182 | |||
| 183 | All rights reserved | ||
| 184 | |||
| 185 | This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||
| 186 | |||
| 187 | =cut |