table width in pixel overlaps div

Reply

Join Date: Apr 2009
Posts: 1
Reputation: vidhi.s is an unknown quantity at this point 
Solved Threads: 0
vidhi.s vidhi.s is offline Offline
Newbie Poster

table width in pixel overlaps div

 
0
  #1
Aug 13th, 2009
Hi,

I have to display content on a page.I want the content to be displayed in 800px space.So I have used a div tag.The following code explains it ...

  1. <div style="width:800px;">
  2.  
  3. <table><tbody><tr><td border="0" valign="top" width="596">
  4. In economics, a recession is a general slowdown in economic activity over a sustained period of time, or a business cycle contraction.During recessions, many macroeconomic indicators vary in a similar way. Production as measured by Gross Domestic Product (GDP), employment, investment spending, capacity utilization, household incomes and business profits all fall during recessions.
  5.  
  6. Governments usually respond to recessions by adopting expansionary macroeconomic policies, such as increasing money supply, increasing government spending and decreasing taxation.
  7.  
  8. </td></tr></tbody></table>
  9. </div>

Because of the width attribute of the td tag ,content is displayed in 596px space.But i want it to be displayed in 800px space so that it covers the entire screen.
Could you please help me solve this problem..


Thanks in advance
Vidhi
Last edited by peter_budo; Aug 13th, 2009 at 12:33 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 101
Reputation: ingeva is an unknown quantity at this point 
Solved Threads: 9
ingeva ingeva is offline Offline
Junior Poster

Re: table width in pixel overlaps div

 
0
  #2
Aug 14th, 2009
Originally Posted by vidhi.s View Post
Hi,

I have to display content on a page.I want the content to be displayed in 800px space.So I have used a div tag.The following code explains it ...

  1. <div style="width:800px;">
  2.  
  3. <table><tbody><tr><td border="0" valign="top" width="596">
  4. ...
  5. </td></tr></tbody></table>
  6. </div>

Because of the width attribute of the td tag ,content is displayed in 596px space.But i want it to be displayed in 800px space so that it covers the entire screen.
Could you please help me solve this problem..
Should be done by just omitting the width attribute. AAMOF you could drop the other attributes also, unless they've been set to another default.
Yes, I'm running Ubuntu. Of course.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: table width in pixel overlaps div

 
0
  #3
Aug 23rd, 2009
If you want the table to be the width of the screen, use:

width: 100%;

Remember that different computers have different screen widths in pixels.
Last edited by MidiMagic; Aug 23rd, 2009 at 8:40 pm.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 2
Reputation: LessZoa is an unknown quantity at this point 
Solved Threads: 0
LessZoa LessZoa is offline Offline
Newbie Poster

Re: table width in pixel overlaps div

 
0
  #4
Aug 25th, 2009
If that is all you have in your table, I would remove the table in its entirety, and just have the content in the div. Makes for better CSS & faster read for browsers.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC