Solved

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

Posted on 2009-04-09
2
484 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 500 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now