Last modified: 2013-03-13 05:01:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33880, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31880 - Formatting numbers in tables should be aligned right
Formatting numbers in tables should be aligned right
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-22 10:05 UTC by DaSch
Modified: 2013-03-13 05:01 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description DaSch 2011-10-22 10:05:00 UTC
Normaly numbers are aligned right in tables
I think this should also be done my SMW, best would be to add a class to all td that contain numbers
Comment 1 Jeroen De Dauw 2011-10-22 11:33:59 UTC
What version of SMW? >= 1.6.2 uses MWs native tables, so there it's really not an SMW issue. Since this version you can specify a css class per column if I'm not mistaken though - an addition Yaron made.
Comment 2 DaSch 2011-10-22 11:58:09 UTC
is there any documentation about this?
Comment 3 Jeroen De Dauw 2011-10-22 18:29:06 UTC
Don't think so. You can look at the table query printer though.
Comment 4 DaSch 2011-10-22 18:36:58 UTC
well for me features that I have to reengenier from the code are not existing features
there can be that much nice features, when nobody knows how to use them they are irelevent
Comment 5 Jeroen De Dauw 2011-10-22 18:45:38 UTC
Then document them, or rage someone (other then me) into doing that.
Comment 6 Markus Krötzsch 2011-10-22 21:06:23 UTC
I think what Jeroen meant is that the original developer of a feature is of course responsible of documenting it. I have re-assigned this bug to Yaron now. I am sure that he can provide some documentation if he did not do this yet (given the recency of the feature, it would be very understandable that it is not fully documented yet, but it might as well be that we are simply not aware of the place where the documentation has been given).
Comment 7 Yaron Koren 2011-10-24 15:33:48 UTC
Good point; I forgot to document the class stuff that I added. I just added this to the documentation - no rage required. :) You can see the new documentation here:

http://semantic-mediawiki.org/wiki/Help:Table_format#Applying_CSS_formatting

The "class" parameter isn't showing up in the automatic documentation, but I'm pretty sure that's just because the version of SMW on semantic-mediawiki.org isn't recent enough.

I should note that this doesn't directly address the original request made, which was about the "Number" type.
Comment 8 DaSch 2011-10-24 16:14:22 UTC
Well with this possibilities there is no way to get the result I want. The class with the column name is only given to the heading. The elements in table body have no class and I have different columns and would like to add a class only to some columns that contain numbers to format them with align right. So this would have to be something that is added to the column query. And I thing that it would make sense to add this to core that numbers are aligned right, because that's the normal behaviour.
Comment 9 Yaron Koren 2011-10-24 21:13:16 UTC
I think this has uncovered two issues. First of all - DaSch, you're right that the addition of a CSS class to the <th> headers can't be used to set the display of the rest of the column. That's my fault - for some reason I thought that a class for the header could be used to affect the rest of the column, but that's not true. I'll have to fix that somehow.

There's another issue, though, which is that there's an "align" parameter that the table format should be handling, but isn't. "align" is mentioned in the documentation (see http://semantic-mediawiki.org/wiki/Help:Inline_queries), as well as in the code for the table format - but it doesn't seem to actually get handled. This looks like a bug introduced in some recent version of SMW.

By the way, I'm not sure if "align" is a regular parameter, meant to cover all columns, or a "sub-parameter" (I forgot the exact term), meant to cover just one column - in other words, with the syntax "|+". The latter would make more sense. Either way, it should be handled.
Comment 10 Yaron Koren 2011-10-25 20:26:22 UTC
I just fixed the first issue in SVN, by adding the "column" class to every cell in the table, not just the cells in the header row. I think the second issue is still there, though.
Comment 11 MWJames 2012-11-07 06:26:49 UTC
This bug hasn't seen any update during the last year and it is unknown if this bug still relates the current SMW 1.8.

Please feel free to reopen this bug again if it applies to SMW 1.8.
Comment 12 DaSch 2012-11-09 21:00:37 UTC
I think we went totaly of course with this request.

The problem is, that numbers should be aligend right in tables to increase readability!
Comment 13 DaSch 2012-11-09 21:31:33 UTC
Just look like this table is formatted and then think about how to do this with SMW table format ;)
https://en.wikipedia.org/wiki/List_country_population

An because numbers, like the list shows dates are always formatted the same way this should be build in
Comment 14 DaSch 2013-03-03 11:47:28 UTC
Is this so complicated to add a class smw-number and smw-date to tabled when they are listed in tables? Aligning everything left is really ugly and I hate ugly things and I have no chance to change this when I can not select the fields by data type. So please add a class for every datatype so that I can format them. PLEASE!
Comment 15 MWJames 2013-03-13 05:01:20 UTC
SMW 1.9

[1] adds a dataValue class attribute (_str, _dat, _num etc.) for the table printer.

[1] https://gerrit.wikimedia.org/r/#/c/53520

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links