0

I've got a table#Content which has a background that extends beyond it's horizontal bounds. I've sliced up the the backgrounds and made a table#Main, with td#Left, td#Content (which contains table#Content), and td#Right. I've set the backgrounds into the td#Left and td#Right, positioned correctly.

  • Question 1) I can't get the whole table#main to be centered on the page.
  • Question 2) The design is beyond 960px. But the main content is within 912px. The td#Left and td#Right are extra. Is there a way to keep the main content centered and if needed shrink the td#Left & td#right.

[update] I'm open to directions towards a div solution.

[update2] I'm going to rephrase the question. How do I make 3 columns fill the screen, with 2 outer columns be auto/% and have the middle one be 912px.

NeerPatel
  • 863
  • 6
  • 19
  • 4
    You are using tables to layout your page's content? – Myles Gray Feb 15 '11 at 17:50
  • 3
    if it's not tabular data, use div. http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html – Sotiris Feb 15 '11 at 17:52
  • 1
    Yeah not to totally trash your question but the above commentors are correct. You really should never use tables to layout your pages content. Google Tableless layouts, and CSS and you will have less headaches in time. – Loktar Feb 15 '11 at 17:54
  • @Myles, you are too fast! Right now, I have 2 tables. One, in an attempt to help solve my problem and the other to help organize the main content. – NeerPatel Feb 15 '11 at 17:55
  • You should post your current (blasphemous table based) code, preferably as a [jsFiddle](http://jsfiddle.net) demo. – thirtydot Feb 15 '11 at 17:57
  • @DjFarout If you provide your table code I will convert it to CSS and Divs for you also please read: http://shouldiusetablesforlayout.com http://www.hotdesign.com/seybold/ http://webdesign.about.com/od/layout/a/aa111102a.htm – Myles Gray Feb 15 '11 at 17:57
  • 3
    Minor addendum to what @Sotiris said: If it's not tabular data, use *the appropriate tags* and style as needed. Div is often a good choice, but it might be an h3, a ul or even just an anchor tag. I see a lot of sites using divs for lists and wrapping links in otherwise-empty divs, and that's possibly even worse than a table-based layout. – Chuck Feb 15 '11 at 18:48
  • Hey there, in update2, you wrote, "I'm going to rephrase the question. How do I make 3 columns fill the screen, with 2 outer columns be auto/% and have the middle one be 912px." Do you have any other requirements (ie - height, etc)? – Greg Hluska Feb 15 '11 at 21:13
  • Is there going to be a footer? and do the outer columns have content? – zzzzBov Feb 15 '11 at 21:33

1 Answers1

1

For the table and margin: 0 auto; to center it if that doesn't work put a surrounding div with that style in it along with a width....

The table background just add background:url(...) center center ;

I'd give you an example but I'm on my phone

Shane
  • 1,603
  • 4
  • 26
  • 54