Prev: CSS inline italics ?
Next: Height of selectbox element
From: Dooing on 5 Jul 2007 11:31 Hi, I am starting with CSS, and I am trying to do a "div table", that has a red 3px border around it. However, the damn border only appears on top of the table. Here's my Code: // left out important stuff #table {width:100%; border:3px solid red;} ..tableHeader {background-color:#FF0000; } ..tableHeaderLeft, .tableHeaderRight {width:50%; background-color:#0f0; float:left;} ..row {background-color:#F000F0} ..cellLeft, .cellRight { width:50%; float:left;} // left out important stuff <div id="table"> <div class="tableHeader"> <div class="tableHeaderLeft">Information</div> <div class="tableHeaderRight">Value</div> </div> <div class="debugRow"><div class="cellLeft">Browser Typ</div><div class="cellRight">Mozilla</div></div> </div> // left out important stuff If I add change the first css line and add a height, for example 20px, I can see a 20px border. But my problem is, I don't know the height of the table, as it will be dynamic. Any ideas?
From: Jim Moe on 5 Jul 2007 12:39 Dooing(a)gmx.de wrote: > Hi, I am starting with CSS, and I am trying to do a "div table", that > has a red 3px border around it. > However, the damn border only appears on top of the table. > > // left out important stuff > Like an URL to a test case. On the face of it your code looks like it ought to work. Apparently the "important stuff" that you left out is affecting the layout. -- jmm (hyphen) list (at) sohnen-moe (dot) com (Remove .AXSPAMGN for email)
From: Bergamot on 5 Jul 2007 16:05 Dooing(a)gmx.de wrote: > I am starting with CSS, and I am trying to do a "div table" > > <div id="table"> > <div class="tableHeader"> > <div class="tableHeaderLeft">Information</div> > <div class="tableHeaderRight">Value</div> > </div> > <div class="debugRow"><div class="cellLeft">Browser Typ</div><div > class="cellRight">Mozilla</div></div> > </div> Why? The notion that all tables are bad is wrong. Use a table for tabular data! -- Berg
From: Dooing on 5 Jul 2007 17:33 > Why? The notion that all tables are bad is wrong. Why? Because I am just trying to practice.
From: Dooing on 5 Jul 2007 17:37
On 5 Jul., 18:39, Jim Moe <jmm-list.AXSPA...(a)sohnen-moe.com> wrote: > Doo...(a)gmx.de wrote: > > Hi, I am starting with CSS, and I am trying to do a "div table", that > > has a red 3px border around it. > > However, the damn border only appears on top of the table. > > > // left out important stuff > > Like an URL to a test case. > On the face of it your code looks like it ought to work. Apparently the > "important stuff" that you left out is affecting the layout. > > -- > jmm (hyphen) list (at) sohnen-moe (dot) com > (Remove .AXSPAMGN for email) Nope, the only thing that is missing is the html and css frames like "<html><head>.........." and they are correct as I pretty much know html, plus if they were not, the page couldn't properly load anyway. The table works, but I want to have a 3 pixel border around my table, but the way it is atm the border is only on top of the table. I found out that when I add font-size:1em; in each row, then it does work, as long as I dont change the font-size. If I change the font size, the red 3 px border again does not surround the entire table. |