Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why my table is moving out of my content area defined through CSS

Posted on 2009-04-09
2
Medium Priority
?
525 Views
Last Modified: 2012-05-06
Why my table is going out of my content area when I have defined it in my content div element. Please take a look.
#mainContent table{
    font: 11px/24px Verdana, Arial, Helvetica, sans-serif;
	border-collapse: collapse;
	margin-right:10px;
	margin-left:10px;
	border: 5px solid #EAEAEA;
	width:parent;
	}

Open in new window

tablesGoingOutOfContentArea.docx
0
Comment
Question by:anas_elkhani
2 Comments
 
LVL 13

Expert Comment

by:myderrick
ID: 24105442
First tables and CSS are not very good friends.

Why did you use width: parent? Clearly the width of the table is larger than the container div or you can say the container div is smaller than the table width.

Try taking out the width property from the table div and check

Awaiting feedback

MD
0
 
LVL 16

Accepted Solution

by:
hankknight earned 1500 total points
ID: 24105698
I can't know the problem for certain without seeing all your CSS.  Try this.
#mainContent table{
    font: 11px/24px Verdana, Arial, Helvetica, sans-serif;
	border-collapse: collapse;
	margin-right:10px;
	margin-left:10px;
	border: 5px solid #EAEAEA;
	display: inline;
	width: 100%;
	}
 
#mainContent {
	display: block;
	position: relative important!;
	width: 100%;
}

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question