On 11/20/2010 03:52 PM, Marc AGATE wrote:
> Vincent,
>
> I apologize. I didn't mean to be unrespectfull, it's not my style (since
> we're talking about styles :) ).
> But...it usually takes longer to hit a db, write some sqls and get the
> expected result than to write align="center", or any style property, but
> that's not the point.
> The css I use is colibri.css through a style.css include statement.
> Strange thing is that despite I am writing this in my script:
>
> (% style="background-color:red;align:center" %)
>
> The html code produced at the end is :
>
> <table style="background-color: red;">
>
> Where the align attribute is simply removed. Also, some<tbody>  tags are
> added.

style="" does not result in attributes, but in CSS style. There is no 
"align" property in CSS (see the full CSS 2.1 reference on 
http://www.w3.org/TR/CSS21/indexlist.html#index-a ). Thus the align 
property is dropped.

There used to be an "align" HTML attribute (deprecated even in HTML 4.0, 
http://www.w3.org/TR/html4/struct/tables.html#adef-align-TABLE ) but 
it's no longer available in XHTML.

> What I meant by locked is the following: why simple html like this:
> "<table align="center"><tr><td>test centering</td></tr></table>"
> Cannot be rendered according to W3C standard?
> I haven't been through the details of xwiki rendering but it looks like
> xwiki css defines styles for at html element level (i.e for all table, all
> h1, etc.. for instance .table { text-align: left}) So basically, a custom
> table (any table) falls under the rules of theses xwiki css.
> If you had defined a .xwikitable set of attributes instead, then the style
> would only apply to a table using class="xwikitable" and a custom table
> would follow whatever style was defined by the web developper.

In theory this should work:

(% align="center" style="background: red;" %)
|1|2|3
|a|b|c

This does generate <table align="center" style="background: red;">..., 
but it still isn't centered, because colibri.css overrides the style 
with a "margin: 0" rule for all elements.

align="center" has the only effect that it provides a different initial 
value for the margin properties, in this case left->auto, right->auto. 
Overriding that initial value means that the align attribute doesn't 
matter anymore.

Still, that portion of CSS at the start of colibri.css is well intended, 
and even though I don't like it at all and I also find that it does more 
harm than it helps, it is strongly supported by lots of people that are 
doing Web Design as a living. This is the origin of the "Reset CSS", as 
it's called: http://meyerweb.com/eric/tools/css/reset/

Now, leaving the problems in colibri.css aside, it's also partly your 
fault since you only tried to stick "align=center" somewhere in there 
and where frustrated when that didn't work. The better solution is 
"margin: auto", since align is not valid CSS, and is deprecated HTML 
(non-valid XHTML).

Peace?

> Anyway, I just tried that margin trick I found on a forum and that you just
> gave me. It works fine.
>
> Again, I didn't mean to show any lack of respect. I was just a bit
> frustrated. That happens. But you could concede me that xwiki documentation
> is not well structured and organized, both in its content and presentation.
> I know it's a challenge, a daunting task, but at some point it's necessary.
>
> Thanks
>
> Marc
>
> -----Message d'origine-----
> De : [email protected] [mailto:[email protected]] De la part de
> Vincent Massol
> Envoyé : samedi 20 novembre 2010 15:26
> À : XWiki Users
> Objet : Re: [xwiki-users] Table Alignement
>
>
> On Nov 20, 2010, at 3:08 PM, Vincent Massol wrote:
>
>> Hi Marc,
>>
>> On Nov 20, 2010, at 1:59 PM, Marc AGATE wrote:
>>
>>> Hi !
>>>
>>>
>>>
>>>         I've been struggling for hours trying to get a Html table centered
>>> on a wiki page. I tried all the suggested syntax I found in the very
> messy
>>> Xwiki documentation
>>
>> What is messy? What do you suggest to make it less "messy"? Can you help?
>>
>>> (i.e, using style="etc.", then using class="myclass")
>>> and I also tried to get rid of all table references in the colibri.css
> file,
>>> but STILL, my table is stuck on the left. It's just driving me nuts to be
>>> able to hit a database in a record time and to spend hours to get the
>>> resulting table centered!
>>
>> Not sure why you think using a database is more complex than using CSS....
> ;)
>> For me it's much harder to use HTML/CSS than hitting a DB!
>>
>>> Any clue? Why is all the rendering locked this way? What's the point ?
>>
>> What do you propose to unlock it (whatever you mean by this)?
>>
>> Regarding the table centering use firebug if you're on FF to find the
> correct CSS.
>
> Just because I'm good (despite your not very respectful email), here's the
> result of my 2 minutes investigation with google and firebug (and people who
> know me know I don't know crap about HTML/CSS ;)):
>
> (% style="margin-left: auto; margin-right: auto;" %)
> |=column1|=column2
> |cell1|cell2
>
> For the record I've found this info on
> http://theodorakis.net/tablecentertest.html
>
> Hope it helps,
> -Vincent
>
>>
>> Thanks
>> -Vincent
>>
>>> By the way, I am running XWiki Enterprise 2.5.1.32531
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Marc


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to