473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

percentage width and em margins problem

I have a table wrapped in a div like this:

<div id="content"><table id="calendar">
<tr>
<th id="caldate"><span>Date</span></th>
<th id="caltitle"><span>Title</span></th>
<th id="caltime"><span>Time</span></th>
<th id="calroom"><span>Room</span></th>
<th id="calvenue"><span>Venue</span></th>
</tr>
<tr>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
</tr>
</table></div>

im using tables as it is tabular data, its not for layout purposes. my
div tag has these properties:

#content {
margin-left: 12.2em;
border: 1px solid #006699;
margin-right: 0.2em;
margin-top: 1em;
}

my table has these properties in the style sheet:

table {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
}
#calendar {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
width: 100%;
}
#calendar tr {
border-bottom: dashed 1px #006EAB
}
#calendar td {
padding: 5px 3px;
}

what happens is the table is taking up 100% of the width of the
document + the 12em margin of the div + the o.2em + 0.2em. shouldnt
the table be taking up 100% of the div width? anybody have a
solution/advice for this problem. As always any help is much
appreciated

Thanks

Andy
Jul 20 '05 #1
2 5126
what happens if you remove the width:100% from the #calendar style?

On 28 Aug 2003 02:09:53 -0700, wh*****@hotmail.com (Andy Moss) wrote:
I have a table wrapped in a div like this:

<div id="content"><table id="calendar">
<tr>
<th id="caldate"><span>Date</span></th>
<th id="caltitle"><span>Title</span></th>
<th id="caltime"><span>Time</span></th>
<th id="calroom"><span>Room</span></th>
<th id="calvenue"><span>Venue</span></th>
</tr>
<tr>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
</tr>
</table></div>

im using tables as it is tabular data, its not for layout purposes. my
div tag has these properties:

#content {
margin-left: 12.2em;
border: 1px solid #006699;
margin-right: 0.2em;
margin-top: 1em;
}

my table has these properties in the style sheet:

table {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
}
#calendar {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
width: 100%;
}
#calendar tr {
border-bottom: dashed 1px #006EAB
}
#calendar td {
padding: 5px 3px;
}

what happens is the table is taking up 100% of the width of the
document + the 12em margin of the div + the o.2em + 0.2em. shouldnt
the table be taking up 100% of the div width? anybody have a
solution/advice for this problem. As always any help is much
appreciated

Thanks

Andy


Jul 20 '05 #2
Gerhard Fiedler wrote:
what happens if you remove the width:100% from the #calendar style?

On 28 Aug 2003 02:09:53 -0700, wh*****@hotmail.com (Andy Moss) wrote:

I have a table wrapped in a div like this:

<div id="content"><table id="calendar">
<tr>
<th id="caldate"><span>Date</span></th>
<th id="caltitle"><span>Title</span></th>
<th id="caltime"><span>Time</span></th>
<th id="calroom"><span>Room</span></th>
<th id="calvenue"><span>Venue</span></th>
</tr>
<tr>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
<td>hgbfdds</td>
</tr>
</table></div>

im using tables as it is tabular data, its not for layout purposes. my
div tag has these properties:

#content {
margin-left: 12.2em;
border: 1px solid #006699;
margin-right: 0.2em;
margin-top: 1em;
}

my table has these properties in the style sheet:

table {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
}
#calendar {
border: none;
margin-left: 0.2em;
margin-right: 0.2em;
width: 100%;
}
#calendar tr {
border-bottom: dashed 1px #006EAB
}
#calendar td {
padding: 5px 3px;
}

what happens is the table is taking up 100% of the width of the
document + the 12em margin of the div + the o.2em + 0.2em. shouldnt
the table be taking up 100% of the div width? anybody have a
solution/advice for this problem. As always any help is much
appreciated

Thanks

Andy


if i remove the width:100% from the #calendar properties it doesn't fill
the containing div. If i use the 100% it works fine in Moz (no surprises
there ;)

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lars G. Svensson | last post by:
As a regular ciwas reader, I learned that fixed-pixel designs are evil, so for the newly created site http://www.ddc-deutsch.de (in German, still very much under construction) I arranged the...
5
by: Josh Renaud | last post by:
I'm still trying to solve a problem I have experienced in Safari. This is my third post on the subject. I'm hoping someone can shed some light. The problem is that, in Safari, a table with no...
2
by: Oliver Burnett-Hall | last post by:
I'm trying to move to using tableless page layouts, but I've come across what appears to be a bug in IE5's rendering that I can't find a way to overcome. The page has a sidebar to the left of...
5
by: ima | last post by:
I'm attempting to use CSS for a three column layout. My problem is that although I'm using width % ie. column1 width 20%, column2 width 60%, and column3 20%, I end up with a horizontal scroll bar...
8
by: Chris | last post by:
I am unable display an image by percent. No matter what method I try, I receive the following error. Input string was not in the correct format. No matter what method I use, I cannot get this...
4
by: patrick j | last post by:
Hi First I must apologise to Mr. Dorayme for my use of his web-page as the example for my question. In order assist in making him feel better I'll mention it is an excellent article. However...
11
by: Gérard Talbot | last post by:
Hello, <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <title></title> <style type="text/css"> body {background-color: white; color: black;}...
6
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box....
5
by: Summercool | last post by:
wow... i didn't know that, for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <span style="width: 100px; background:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.