Hybrid View
-
23 Oct 2007 7:54 AM #1
Centering Toolbar Items
Centering Toolbar Items
Hello, everyone.
Hopefully, a simple question: is there any quick-and-dirty way to center the content of a Toolbar?
It's left-flush by default, and right-flush if you add a fill. Is there any way to center it?
I've used Firebug to inspect the HTML code that the Toolbar scripts create and tried most of the basic centering tools (display:block and margin:auto, text-align:center, align=center, etc.), but they all seem to be overwritten by the flush-left alignment unless I add a greedy spacer.
I didn't expect this to work, but I also added a second greedy spacer to the other side. Sure enough, no luck.
I'd hardcode margins, but the area that the toolbar is being placed in is relative to the window size, so it would not adjust accordingly.
Thank you very much.
-
23 Oct 2007 10:34 AM #2
Code:myToolbar.getEl().child("table").wrap({tag:'center'})
-
23 Oct 2007 10:51 AM #3
Thank you!
Thank you!
Animal,
Thank You! I was just trying to figure this out today as well!
Joe
-
23 Oct 2007 11:09 AM #4
There is no Dr. Cox quote in existence to describe my appreciation.
Thank you very much. Worked like a charm.
-
25 Mar 2008 12:21 PM #5
Centering Toolbar Items
Centering Toolbar Items
Animal, thanks much! I was actually looking for this as well!!
-
16 Jul 2008 9:58 PM #6
Same problem but different
Same problem but different
Hi,
I have a upper toollbar in a panle. The only element i have in the tollbar is a combo box.
I tried to center the combo box the way you explain. It works on firefox but in IE only the combo box is centered but the combo-list is not. The <center> does not effect the list.
Am i doing something wrong??


Reply With Quote