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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacement of HTML Table With CSS not working

Status
Not open for further replies.

Jillq

Programmer
Jun 28, 2008
30
US
My site has in the header.php file
______________________
media="screen" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css"> textarea {width:50%;} </style>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
</head>

<body>
<div id="contentheader">
<table cellpadding="0" cellspacing="0">
<tr align="center">
<td>ACTUAL SOLUTIONS</td>
<td class="dots">::</td>
<td>ACTUAL CURES</td>
</tr>
</table>
</div>
__________________________________

in the CSS is
_________________________________
div#contentheader {
padding:1.2em 140px;
background-color:#BFBFFF;
}
div#contentheader table {
width:100%;
}
div#contentheader table td {
font-size:1.2em;
color:#3F3F7F;
font-weight:bold;
}
______________________________

I added this to the new CSS code
_______________________________
div.c2 {width: 100%;}
div.c1 {float: left; width: 33%;}
_______________________________

and in the header I replaced the HTML table with this new code

________________________________
<div class="c2">
<div class="c1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Actual Solutions</div>
<div class="c1"><em>::</em></div>
<div class="c1">Actual Cures&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
</div>
______________________________________

The new code validates on it's own, but when placed it in my website, something I'm doing wrong is not allowing the new code to work.
All I'm trying to do is replace an html table with CSS.

Have any idea why the new code isn't working on my site?

Thanks,

JillQ
 
Traingamer,

One thing I wanted to add was that what we found is there are several or more ways to simulate HTML tables with CSS, but there is no way to simulate an HTML table in a fluid width area (or column) with CSS.


Jillq
 
...but there is no way to simulate an HTML table in a fluid width area (or column) with CSS.
I guess it depends on what you are trying to accomplish. I was certainly not trying to simulate a table. Tables should only be used for tabular data.

I am assuming that you want to display Actual Solutions :: Actual Cures on your site in some manner (which you have not clearly defined).

So what is it that you are really trying to accomplish? I think your entire site would benefit from the judicious usage of min-width (with a default back to width for IE6), but that wasn't the question you asked. Are you actually looking for fluid layout help?

faq219-2884

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top