Commits

Toby Inkster committed 3c3f932

<th> elements default to center alignment

  • Participants
  • Parent commits 824f156

Comments (0)

Files changed (3)

lib/HTML/HTML5/Table/Cell.pm

 	default   => sub { [] },
 	);
 
+has default_alignment => (
+	is        => 'ro',
+	isa       => 'Str',
+	default   => 'left',
+	);
+
 sub colspan
 {
 	my ($self) = @_;
 	{
 		return lc $self->col->group->node->getAttribute('align');
 	}
-	return 'left';
+	return lc $self->default_alignment;
 }
 
 1;

lib/HTML/HTML5/Table/HeadCell.pm

 use Moose;
 extends 'HTML::HTML5::Table::Cell';
 
+has '+default_alignment' => ( default   => 'center' );
+
 1;
 foo to the bar to the foo to the bar
 to the foo to the bar to the foo.
 =======================================
- A       | B        | C        | D    
+    A    |    B     |    C     |   D  
 =======================================
- 1       | Big                 | i    
+    1    | Big                 | i    
          | monkey-ass cell!!!  |      
          | 1                   |      
          | 2                   |      
 ---------| 3                   |-------
- 2       | 4                   | ii   
+    2    | 4                   | ii   
          | 5                   |      
          | 6                   |      
          |                     |