Last modified: 2013-03-13 05:01:20 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
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.
is there any documentation about this?
Don't think so. You can look at the table query printer though.
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
Then document them, or rage someone (other then me) into doing that.
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).
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.
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.
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.
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.
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.
I think we went totaly of course with this request. The problem is, that numbers should be aligend right in tables to increase readability!
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
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!
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