4 Replies - 2715 Views - Last Post: 16 September 2012 - 12:32 AM

#1 sandaruwanc  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

Center a Table in the Web Page

Posted 15 September 2012 - 03:35 AM

How can I Center a table in my webpage? I need to center it in the whole web page.. Is there a way to do this??? Please Help me
Is This A Good Question/Topic? 0
  • +

Replies To: Center a Table in the Web Page

#2 StefanOnRails  Icon User is offline

  • D.I.C Head

Reputation: 35
  • View blog
  • Posts: 106
  • Joined: 31-July 12

Re: Center a Table in the Web Page

Posted 15 September 2012 - 04:27 AM

Wrap that table into a div with a class of "center" and then use CSS to center it.
.center{
  margin: 0 auto;
  width: ?px; /* your div width */
}


Was This Post Helpful? 0
  • +
  • -

#3 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1381
  • View blog
  • Posts: 3,511
  • Joined: 28-November 09

Re: Center a Table in the Web Page

Posted 15 September 2012 - 12:49 PM

Unless this is required for a class, you should not use tables in web design.
Was This Post Helpful? 0
  • +
  • -

#4 sandaruwanc  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

Re: Center a Table in the Web Page

Posted 15 September 2012 - 10:19 PM

View PostLemur, on 16 September 2012 - 01:19 AM, said:

Unless this is required for a class, you should not use tables in web design.


I didn't get u sir... Will u please explain it for me??
Was This Post Helpful? 0
  • +
  • -

#5 StefanOnRails  Icon User is offline

  • D.I.C Head

Reputation: 35
  • View blog
  • Posts: 106
  • Joined: 31-July 12

Re: Center a Table in the Web Page

Posted 16 September 2012 - 12:32 AM

View Postsandaruwanc, on 16 September 2012 - 07:19 AM, said:

View PostLemur, on 16 September 2012 - 01:19 AM, said:

Unless this is required for a class, you should not use tables in web design.


I didn't get u sir... Will u please explain it for me??

He meant that using tables in order to layout your website is an obsolete technique and should not be used anymore. I suggest checking these tutorials to really get the basics of web design:


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1