vForums Support > Programming & Coding :: Code Requests & Support :: > Center Nav Tree

Center Nav Tree - Posted By VeaZna (veazna) on 8th Oct 08 at 10:28pm
I tried css but failed. It's either I did it wrong or it can't be done with css.

Re: Center Nav Tree - Posted By dog199200 (dog199200) on 9th Oct 08 at 1:59am
OK using the same setup as the logo aligning, this should work.

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. document.getElementsByClassName("nav_tree")[0].align = 'center';
  4. //-->
  5. </script>
 

Re: Center Nav Tree - Posted By VeaZna (veazna) on 9th Oct 08 at 2:06am
sorry, the code doesn't work.

Re: Center Nav Tree - Posted By dog199200 (dog199200) on 9th Oct 08 at 2:19am
OK now if its going to work at all, then it will work with one of theses, I''m not suire if the table has to be defined so try both of them and see if they work:

Global Header:

Code:
 
  1. <style type="text/css">
  2. .nav_tree td {
  3.      text-align: center;
  4. }
  5. </style>
 


Or

Code:
 
  1. <style type="text/css">
  2. .nav_tree {
  3.      text-align: center;
  4. }
  5. </style>
 


I know the JS was right, so I just hope this css works.

Re: Center Nav Tree - Posted By VeaZna (veazna) on 9th Oct 08 at 2:24am
sorry, none of them work.

Re: Center Nav Tree - Posted By dog199200 (dog199200) on 9th Oct 08 at 2:30am
crap, I wonder if its possible to move the nav tree.. Because that should of worked. and I had even tested a few other ways taht i didnt post and they didn't work either, so edit the threads title and add (Marc) to it and he'll get to it when he can, sorry I tried.

Re: Center Nav Tree - Posted By VeaZna (veazna) on 9th Oct 08 at 2:34am
I think it is possible cuz if u could put the nav tree in a table, u probably can center it

thanks for trying! {Grin}

Re: Center Nav Tree - Posted By dog199200 (dog199200) on 9th Oct 08 at 2:38am
ya i know, and I even tried to modify the code that put it into a table as well and that wouldnt work either.

Re: Center Nav Tree - Posted By Ross (admin) on 9th Oct 08 at 8:35am
You weren't far off with text-align {Smile}

Code:
 
  1. <style type="text/css">
  2. <!--
  3. #nav_tree {
  4. display: block;
  5. text-align: center;
  6. }
  7. //-->
  8. </style>
 

Re: Center Nav Tree - Posted By dog199200 (dog199200) on 9th Oct 08 at 11:43am
{Smile} ah ok, i see what I did wrong

Re: Center Nav Tree - Posted By VeaZna (veazna) on 11th Oct 08 at 4:35am
Thanks Ross! {Smile}