Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

710 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