NetTalk Central

Author Topic: Center a browse on a web page  (Read 4866 times)

roberti

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Center a browse on a web page
« on: September 19, 2007, 02:16:58 AM »
Hallo,

How can I have a browse centered in a web page ?

I try:

<center><!-- Net:Browse_Candidates --></center>
or
<align="center"><!-- Net:Browse_Candidates -->

but didn't work ..... :(



Thank you,
Robert Iliuta

roberti

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Center a browse on a web page
« Reply #1 on: September 19, 2007, 02:24:51 AM »
I found the solution:


<DIV align="center"><TABLE>

<!-- Net:Browse_Candidates -->

</DIV>
</TABLE>



this works for me. Maybe will be useful for someone. :)


Regards,
Robert Iliuta

seancameron

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • CapeSoft Software
Re: Center a browse on a web page
« Reply #2 on: September 20, 2007, 01:57:33 AM »
The align attribute is deprecated in the current HTML 4.01 and XHTML 1.0 specifications and hence it is recommend that you don't use this attribute. You should use CSS to do the formatting:

<table style="width: 50%; margin-left: auto; margin-right: auto;">
</table>

Specifying the width of the table in either pixels or percentage is optional, and the table will expand if the contents are large than the size specified anyway.

For block elements you can use the text-align CSS attribute:
<div style="text-align: center;">
</div>

Even better you could move these to the CSS file:

.center { margin-left: auto; margin-right: auto;}

and then in the code:

<table class="center">
</table>

<div class="center">
</div>


Regards,

Sean Cameron
Capesoft
www.capesoft.com
Sean Cameron
CapeSoft
www.capesoft.com

Work Smarter, Not Harder

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Center a browse on a web page
« Reply #3 on: September 25, 2007, 12:01:30 AM »
Hi Robert,

be aware that your closing tags are backwards - should be

<DIV align="center"><TABLE>

<!-- Net:Browse_Candidates -->

</TABLE>
</DIV>