This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > July 2007 > CSS Table





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CSS Table
Dooing@gmx.de

2007-07-05, 6:18 pm

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?

Jim Moe

2007-07-05, 6:18 pm

Dooing@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)
Bergamot

2007-07-05, 6:18 pm

Dooing@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
Dooing@gmx.de

2007-07-05, 6:18 pm


> Why? The notion that all tables are bad is wrong.


Why? Because I am just trying to practice.

Dooing@gmx.de

2007-07-05, 6:18 pm

On 5 Jul., 18:39, Jim Moe <jmm-list.AXSPA...@sohnen-moe.com> wrote:
> Doo...@gmx.de wrote:
>
>
> 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.

Jukka K. Korpela

2007-07-05, 6:18 pm

Scripsit Dooing@gmx.de:

>
> Why? Because I am just trying to practice.


Then you should have told us that this is just an exercise in futility,
rather than using CSS in authoring for the WWW, which is the topic area of
this group.

There might be some sense in writing CSS code that presents an element (not
marked up as table) in a tabular manner, using the table-related values of
the display property and other CSS constructs - but seldom in the WWW
context at present, since the dominant browser ignores those table-related
values.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Sherm Pendley

2007-07-05, 10:15 pm

Dooing@gmx.de writes:

>
> Why? Because I am just trying to practice.


Careful with that - if you practice bad ideas, you'll use them when it
counts out of habit.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews