HighDots Forums  

Table in Div

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Table in Div in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sandanz
 
Posts: n/a

Default Table in Div - 01-03-2008 , 10:47 AM






I have tables nested in an AP Div. The table width is set in CSS. It renders ok
in browsers, but on my local site the table is 1800 or more pixels, extends
past the div it is nested in, and I can't adjust column widths.

Also, can't figure out how to center table within div.

http://www.viva-city.info/cityLife_civic.htm


Reply With Quote
  #2  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Table in Div - 01-03-2008 , 10:58 AM






Here's why you may not want to do this -

http://www.great-web-sights.com/g_layer-overlap.asp

Anyhow, this CSS rule is causing your problem -

#table, tr, td {

border: 1px solid #b8b8b8;

background-color: #131313;

td padding: 6px;

width: 600px;

padding-top: 2px;

padding-right: 2px;

padding-bottom: 2px;

padding-left: 4px;

background-position: center;

}

It's setting your <td> widths to 600px.

In general you have WAY TOO MUCH (verbose and redundant) CSS in there....


--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"sandanz" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I have tables nested in an AP Div. The table width is set in CSS. It
renders ok
in browsers, but on my local site the table is 1800 or more pixels,
extends
past the div it is nested in, and I can't adjust column widths.

Also, can't figure out how to center table within div.

http://www.viva-city.info/cityLife_civic.htm



Reply With Quote
  #3  
Old   
sandanz
 
Posts: n/a

Default Re: Table in Div - 01-03-2008 , 11:04 AM



So how do I write a CSS rule to set the border colors, padding, and table centered within div?

Sorry, I'm new at this.

Reply With Quote
  #4  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Table in Div - 01-03-2008 , 11:37 AM



The rule I quoted does ever so much more than that. If you want that rule
to apply only to the table tag, it should be like this -

table {
border: 1px solid #b8b8b8;
background-color: #131313;
width: 600px;
}
td {
padding: 2px 2px 2px 4px;
background-position: center;
}

although I'm not clear on where the background position should be placed,
since I don't know if you intended it to apply to the <table> or the <td>.

Note also that you used an octothorpe ("#") as the first character of your
selector which, in this case, was inappropriate since that looks for an
element with id ="table", and you are wanting to just style the table tag -
<table>. In this case, you would just use a tag selector - 'table'.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"sandanz" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
So how do I write a CSS rule to set the border colors, padding, and table
centered within div?

Sorry, I'm new at this.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.