Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS code tables

Status
Not open for further replies.

madcgimonk

Programmer
Oct 8, 2004
25
US
I am horribly new at CSS and was wondering if someone could give me the CSS and HTML needed to make the CODE table.

Ie.

Code:
I want this box

I read the source code and loaded the CSS style sheets for this site, but that wasn't very useful. lol.

I just need the HTML and the CSS code to make it. The CSS will be on the page itself (it won't be external) and no idea where to start.

Can anyone help me with this?
 
the basic code would be something like this;
styles
Code:
.code_box {
width:80%;
padding:0px 2px;
margin:0px auto;
}
.code_box_header {
color:#FFFFFF;
background-color:#666666;
text-transform:uppercase;
}
HTML
Code:
<div style="code_box">
<div style="code_box_header">code</div>
<pre>
code data
</pre>
</div>



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Hi Chris.

Thanks for your help. I must be a total idiot though because I can't get that code to work. I am trying to get this code working on my list of tutorials.

The page I'm testing on first is: . You can see where it says "code #!/usr/bin/perl" near the top.

Do you have any idea why the table itself isn't showing up?

Thank you.
 
maybe if I hadn't [curse]ed up the code it would work.

in the HTML replace <div style="... with <div class="...

where's the [doh] smiley when you need one [ponder]




Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
LOL. Well that certainly did help a bit :)

It looks a lot better now than it did although I don't get the super cool side borders like the version here does.

I made the opinion a long time ago that I hated CSS with a passion. lol. I think I might just have to stick with that thought!

Thanks for your help.
 
Anyway, I did manage to get it about perfect now. I think I'll fiddle to get the font right but it looks good enough :)

The code I used was

Code:
.code_box {
width:80%;
margin:0px auto;
border-width : 2px;
border-style : inset;
}
.code_box_header {
color:#FFFFFF;
background-color:#666666;
text-transform:uppercase;
}

Thanks for your help Chris!
 
add some borders

Code:
.code_box {
width:80%;
padding:0px 2px;
margin:0px auto;
border:2px double #E8E8E8;
border-top:2px solid #666666;
border-left:2px solid #666666;
}


Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top