Can CSS do this?

Y

yesthatmcgurk

Can someone show me the equivalent in CSS, and explain how it is better
(not meaning to sound trollish; just interested):

<table id="iCantDoThisEasilyWithCSS" width=100% height=100%>
<tr>
<td width=50% align=left>Stuff all kinds of neat junk in here,
like controls and such</td>
<td width=auto align=right>More stuff, crammed over on the
right hand side</td>
</tr>
</table>

This works in all browsers and can be nested inside of div's and other
tables without wierdness happening. I tried to do this with a floating
div, but the damn thing wouldn't work like I expected (
 
M

Mike Scirocco

Can someone show me the equivalent in CSS, and explain how it is better
(not meaning to sound trollish; just interested):

<table id="iCantDoThisEasilyWithCSS" width=100% height=100%>
<tr>
<td width=50% align=left>Stuff all kinds of neat junk in here,
like controls and such</td>
<td width=auto align=right>More stuff, crammed over on the
right hand side</td>
</tr>
</table>

This works in all browsers and can be nested inside of div's and other
tables without wierdness happening. I tried to do this with a floating
div, but the damn thing wouldn't work like I expected (

Post your code minus the content.
 
Y

yesthatmcgurk

? This is what I'm looking for an equivalent in CSS for. I've got
about ten aborted attempts in CSS, none of which behaved well. I wiped
it all out and went back to the table layout because I can't spend more
time on it...

<table width=100% height=100%>
<tr>
<td width=50% align=left></td>
<td width=auto align=right></td>
</tr>
</table>
 
D

dorayme

Can someone show me the equivalent in CSS, and explain how it is better
(not meaning to sound trollish; just interested):

<table id="iCantDoThisEasilyWithCSS" width=100% height=100%>
<tr>
<td width=50% align=left>Stuff all kinds of neat junk in here,
like controls and such</td>
<td width=auto align=right>More stuff, crammed over on the
right hand side</td>
</tr>
</table>

This works in all browsers and can be nested inside of div's and other
tables without wierdness happening. I tried to do this with a floating
div, but the damn thing wouldn't work like I expected (

What is the id for?

Anyway, no, you won't be able to do this without weirdness
happening for you as you adapt any suggestion in css to your
needs. CSS is essentially weird and you will need to delve into
the black magic to control it and make it produce reasonable
effects in most browsers. A magician could teach you to mimic
just one part of his act but when the curtain goes up and the
lights beam down on you, you need more to steady your trembling
knees.

Why not start with a very readable

http://www.w3.org/MarkUp/Guide/Style

and/or

http://www.htmldog.com/guides/htmlbeginner/
 
T

Toby Inkster

yesthatmcgurk said:
<table width=100% height=100%>
<tr>
<td width=50% align=left></td>
<td width=auto align=right></td>
</tr>
</table>

<div class=c-wrapper>
<div class=c-right>Content here</div>
<div class=c-left>Navigation here</div>
<br class=c-clear>
</div>

DIV.c-wrapper {
position: relative;
}

DIV.c-wrapper DIV.c-right {
width: 65%;
float: right;
margin-right: 2%;
}

DIV.c-wrapper DIV.c-left {
width: 30%;
float: right;
margin-right: 1%;
}

DIV.c-wrapper BR.c-clear {
clear: right;
}

e.g.
http://examples.tobyinkster.co.uk/2col
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top