473,414 Members | 1,988 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,414 software developers and data experts.

row width = div width

Hello,

I have a <table> within a <div> that I populate with a js array. An
eventhandler changes the data displayed.

I'd like the row width to remain equal to the div width, although the
contained data usually isn't wide enough the stretch to div width.
thanks for any help

Ward

Apr 12 '06 #1
4 1959
Ward Germonpré wrote:
I have a <table> within a <div> that I populate with a js array. An
eventhandler changes the data displayed.

I'd like the row width to remain equal to the div width, although the
contained data usually isn't wide enough the stretch to div width.


table {
width: 100%;
}

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Apr 12 '06 #2
Johannes Koch <ko**@w3development.de> wrote in news:443cd923$0$11086
$8*******@authen.yellow.readfreenews.net:
Ward Germonpré wrote:
I have a <table> within a <div> that I populate with a js array. An
eventhandler changes the data displayed.

I'd like the row width to remain equal to the div width, although the
contained data usually isn't wide enough the stretch to div width.


table {
width: 100%;
}


I know that should work but it doesn't.
The table is nested like so :

<div id="content><div id="subcontent"><table id="resultaattbl"> ...
Below is part of my stylesheet that pertains to the above, and FF is my
targetbrowser :
div#content {
position:fixed;
margin-top:40px;
margin-left:170px;
width:780px;
height:550px;
border:1px solid gray;
padding:0px;
}

div#subcontent {
position:fixed;
margin-top:20px;
margin-left:0px;
width:780px;
height:600px;
padding:0px;
/*overflow: auto;*/
}

table#resultaattbl {
width:100%;

}

table#resultaattbl tr{
padding: 5px;
background-color:#DDDDDD;

}

table#resultaattbl td{
padding: 5px;
}
table#resultaattbl tr:hover {
background-color: #BA2A12;
color:#FFFFFF;
}
thanks for your help,

Ward
Apr 12 '06 #3
"Ward Germonpré" <ki**********@forpresident.com> wrote in
news:Xn**********************************@195.130. 132.70:
Johannes Koch <ko**@w3development.de> wrote in news:443cd923$0$11086
$8*******@authen.yellow.readfreenews.net:
Ward Germonpré wrote:
I have a <table> within a <div> that I populate with a js array. An
eventhandler changes the data displayed.

I'd like the row width to remain equal to the div width, although the
contained data usually isn't wide enough the stretch to div width.


table {
width: 100%;
}


I know that should work but it doesn't.
The table is nested like so :

<div id="content><div id="subcontent"><table id="resultaattbl"> ...
Below is part of my stylesheet that pertains to the above, and FF is my
targetbrowser :
div#content {
position:fixed;
margin-top:40px;
margin-left:170px;
width:780px;
height:550px;
border:1px solid gray;
padding:0px;
}

div#subcontent {
position:fixed;
margin-top:20px;
margin-left:0px;
width:780px;
height:600px;
padding:0px;
/*overflow: auto;*/
}

table#resultaattbl {
width:100%;

}

table#resultaattbl tr{
padding: 5px;
background-color:#DDDDDD;

}

table#resultaattbl td{
padding: 5px;
}
table#resultaattbl tr:hover {
background-color: #BA2A12;
color:#FFFFFF;
}
thanks for your help,

Ward


Found it !!

This needed to change :
div#subcontent {
position:fixed;
thanks for seeding,

Ward
Apr 12 '06 #4
Ward Germonpré wrote:
<div id="content><div id="subcontent"><table id="resultaattbl"> ...

Below is part of my stylesheet that pertains to the above, and FF is my
targetbrowser :

div#content {
position:fixed;
margin-top:40px;
margin-left:170px;
width:780px;
height:550px;
border:1px solid gray;
padding:0px;
}

div#subcontent {
position:fixed;
margin-top:20px;
margin-left:0px;
width:780px;
height:600px;
padding:0px;
/*overflow: auto;*/
}


BTW, div#subcontent block height (600px + 20px = 620px) does not fit
into div#content (550px)

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Apr 12 '06 #5

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

Similar topics

2
by: Alex Shi | last post by:
In php, is there a way obtain the width of a charactor of a certain font? Alex -- ================================================== Cell Phone Batteries at 30-50%+ off retail prices!...
7
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified...
16
by: karlman | last post by:
I am trying to create a web page that shows a calendar schedules. I am attempting to use table cells with fixed widths and different colors to display this. It seems that IE6 doesn't always...
0
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
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: Taras_96 | last post by:
Hi everyone, Can anyone tell me why the top paragraph block stretches across the screen (as you would expect), while the bottom div doesn't stretch across the entire screen? When I set the width...
4
by: lilOlMe | last post by:
Hi there! I'm developing a "scrollable table". At first I started using CSS. It worked pretty well until I found a bug that happens when placing this table into a tabbing control... So I...
2
by: Jukka K. Korpela | last post by:
Sub titulo "Re: DIV borders different in IE7 when in td" scripsit Ben C: This seems to be the heart of the matter, and I'm trying to get a real discussion started, by moving the discussion to...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.