Page MenuHomePhabricator

Make a nice way of building HTML tables
Open, LowestPublic

Description

$out->addHTML( Html::openElement( 'table', [ 'class' => 'TablePager' ] ) );
$out->addHTML( '<thead>' );
$out->addHTML( '<tr>' );
$out->addHTML( '<th>' );

Things like that, just suck

Having a table object(or something)..

$table->openTable();

$table->addHeaderRow( array( 'foo', 'bar, 'baz' ) );

$table->openBody();

$table->addRow( array( 'lol', '1', '2' ) );
$table->addRow( array( 'zing', '3', '4' ) );

$table->closeBody();

$table->closeTable();

Or something, whatever, would be nicer...

Maybe some part of OutputPage or something?

Details

Reference
bz30371

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:51 PM
bzimport set Reference to bz30371.
bzimport added a subscriber: Unknown Object (MLST).
Reedy created this task.Aug 14 2011, 7:37 PM
demon added a comment.Aug 14 2011, 7:40 PM

Ew not OutputPage, it could be used in lots of other places too. Make a TableBuilder class or something.

We've got HTMLForm. Writing a HTMLTable class makes sense.

Qgil added a comment.Mar 16 2013, 5:38 AM

Is this still an interesting feature? What possibilities would it bring to, say, Wikipedia editors compared with the current options of wikitext tables + basic html tables?

I guess nobody is currently planning to work on this?

Qgil added a comment.Nov 19 2013, 11:38 PM

(In reply to comment #2)

We've got HTMLForm. Writing a HTMLTable class makes sense.

Would this still be a good idea? Is this a task simple enough for a Google Code-in student?

https://www.mediawiki.org/wiki/Google_Code-In

(In reply to comment #2)

We've got HTMLForm. Writing a HTMLTable class makes sense.

Ugh, I'd say that not really. The class we're imagining here would probably be more akin to XmlSelect.

(In reply to comment #3)

What possibilities would it bring to,
say, Wikipedia editors compared with the current options of wikitext tables +
basic html tables?

None, because it's not related. This is only about nicer methods of generating tables on PHP-side.

It should be simple enough for GCI, assuming that a) we want this and b) we have some use-cases.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 24 2015, 12:29 PM
matmarex updated the task description. (Show Details)Mar 7 2017, 9:07 PM
demon removed a subscriber: demon.Mar 9 2017, 9:42 PM
Qgil removed a subscriber: Qgil.Mar 13 2017, 5:26 PM
Krinkle removed a subscriber: Krinkle.Mar 14 2017, 12:21 AM