Solved

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

Posted on 2009-04-09
2
518 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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.
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 style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

623 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