Tables in HTML

\\OFF-TOPIC// conversations about everything that has nothing to do with Conquer Club.

Moderator: Community Team

Forum rules
Please read the Community Guidelines before posting.
Post Reply
User avatar
Jace-N
Posts: 2
Joined: Thu Sep 10, 2009 2:59 pm

Tables in HTML

Post by Jace-N »

I am designing a personal website for a friend. On two pages of the website I am using a table to display information. Everything is working and showing up properly, but the table is not centered on the web page. Can anyone help me figure out how to get it centered?
silent wind
Posts: 5
Joined: Sat Jan 23, 2010 8:24 pm

Re: Tables in HTML

Post by silent wind »

Jace-N wrote:I am designing a personal website for a friend. On two pages of the website I am using a table to display information. Everything is working and showing up properly, but the table is not centered on the web page. Can anyone help me figure out how to get it centered?

Code: Select all

<center> 
  <table>  
    <tr> 
      <td> </td> 
    </tr>
  </table>
</center>
That is how I would do it...

Unless you are using CSS... then you can use the style elements to control that. Everything will be centered though... including your cell content... so if you want that stuff to be aligned differently, I think you have to do something like <table align="left"> which will bump everything in the table over to a left alignment.

hope that helps.
User avatar
hecter
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Gender: Female
Location: Tying somebody up on the third floor
Contact:

Re: Tables in HTML

Post by hecter »

I'd recommend using CSS. If you don't know it, you should learn it.
http://w3schools.com/
For all your web-based learning needs. It's pretty good. Don't take the tests they offer though, it would be a waste of money. For the time being, just try:

Code: Select all

<table style="width: XX%; margin: 0 auto 0 auto">
    ...
</table>
That will centre the table without also centring EVERYTHING IN the table.
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.
Image
User avatar
Jace-N
Posts: 2
Joined: Thu Sep 10, 2009 2:59 pm

Re: Tables in HTML

Post by Jace-N »

Ive tried both but neither have worked. I have no idea as to why. I guess I'll just have to keep messing with it.
User avatar
hecter
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Gender: Female
Location: Tying somebody up on the third floor
Contact:

Re: Tables in HTML

Post by hecter »

Jace-N wrote:Ive tried both but neither have worked. I have no idea as to why. I guess I'll just have to keep messing with it.
Can we see your source code?
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.
Image
User avatar
Optimus Prime
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm
Gender: Male

Re: Tables in HTML

Post by Optimus Prime »

As hecter said, learning CSS will take you a lot further in building a website than using a table based layout.
Post Reply

Return to “Acceptable Content”