navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

How can I do this without a table?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> How can I do this without a table?
Page: [1]
 
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
How can I do this without a table? - 5/3/2006 15:47:42   
Any thoughts on how to do something as in the image below? Specifically, having the word Note float to the left and the rest of the text left-aligned to the right.




Thumbnail Image
:)

Attachment (1)

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 15:58:26   
Here's one way:

http://www.rogerdouglass.com/btb.asp

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to BeTheBall)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 18:10:02   
This method sets up a hanging indent by using a negative text-align. With this though, you need to set it in it's own Div with plenty of padding round it otherwise the "outdented" line will shoot out of the container

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to rdouglass)
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 19:03:50   
Hi Duane, another option using a definition list. I've been playing around with code from Max Design.

Forgive the nursery rhymes, I get bored with latin text.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=windows-1252" />
<title>DL Test</title>

<style type="text/css">

dl.rhyme {
margin: 2em 0;
padding: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 0.85em;
}

.rhyme dt {
width: 10%;
float: left;
margin: 0;
padding: .5em;
font-weight: bold;
}

/* commented backslash hack for mac-ie5 \*/
dt { clear: both; }
/* end hack */

.rhyme dd {
float: left;
width: 80%;
margin: 0;
padding: .5em;
}
</style>
</head>
<body>

<dl class="rhyme">
<dt>Diddle</dt>
<dd>Hey, diddle, diddle, The cat and the fiddle, The cow jumped over the moon. The little dog laughed To see such sport, And the dish ran away with the spoon.</dd>
<dt>Twinkle</dt>
<dd>Twinkle, twinkle, little star, How I wonder what you are. Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are.</dd>
<dt>Pussycat</dt>
<dd>Pussycat, pussycat, where have you been? I've been to London to visit the Queen. Pussycat, pussycat, what did you there? I frightened a little mouse under her chair.</dd>
<dt>Spider</dt>
<dd>Eencey Weencey spider, climed up the water spout; Down came the rain, and washed poor Eencey out; Out came the sun, and dried up all the rain; And the Eencey Weencey spider, climbed up the spout again.</dd>
</dl>

</body>
</html>


_____________________________

Sally

(in reply to BeTheBall)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 19:15:52   
Thanks for all the suggestions. I am sure I will pick the one that involved the least amount of coding . . . just my nature. :)

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to rubyaim)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 19:28:10   
Yes you can use Definition lists for all sorts of things but they are really meant for definitions and will be read as such by screen readers.

In Duane's case he just needs a visual representation of some text for emphasis.

You should be able to see the page on my example properly now, I was mucking around with my css so things may have been unreadable when you got there.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to BeTheBall)
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 19:40:01   
I did say I was only playing :)

The more options there are the better you can find something that suits whatever you are trying to do.

I'd have no hesitation using a DL like this on my Intranet, but would think about other options for something available to the entire world.



_____________________________

Sally

(in reply to jaybee)
jaybee

 

Posts: 14157
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 19:51:16   
dl are great but there has been a lot of discussion about their use for things other than defs. At one time people were using them for menus (I did) which they do very nicely but it always comes back to screen readers and confusing users.

That Max Design example you gave is a perfect example of using them to replace tables for definitions.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to rubyaim)
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 20:12:03   
And in case anyone lands on this after a search, here is more on definition lists:
W3C - Definition lists: the DL, DT, and DD elements

The Max Design site also has an explanation:
What are definition lists?

_____________________________

Sally

(in reply to jaybee)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: How can I do this without a table? - 5/3/2006 20:33:35   
I wondered whether the use would be proper or not as well, but in this case one could argue that the text following the word note is a "definition" of that particular Note. Probably a stretch, but conceivable.

quote:

You should be able to see the page on my example properly now, I was mucking around with my css so things may have been unreadable when you got there.


Very nice jaybee. Thanks again to all for the help.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to rubyaim)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: How can I do this without a table? - 5/4/2006 18:31:20   
Roger, ran into a bit of a dilemma with your method. Try adding some text in a <p> tag just below the divs and then view the page in FF or Opera. The line of text ends up several inches below the text in the divs. I can see how this CSS stuff could lead to a drinking problem!


Edit - Curiously, change the HTML version in your doctype to 4.01 and the problem is resolved.

:)

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to BeTheBall)
rdouglass

 

Posts: 9228
From: Biddeford, ME USA
Status: offline

 
RE: How can I do this without a table? - 5/5/2006 9:21:52   
quote:

change the HTML version in your doctype to 4.01 and the problem is resolved.


That *thing* again...:) Anyways, that was a very quick 'throw together' just to give an example. It is simple and I like simple (if CSS can *ever* be simple that is.:))

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6359
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: How can I do this without a table? - 5/5/2006 9:51:54   
quote:

ORIGINAL: rdouglass

quote:

change the HTML version in your doctype to 4.01 and the problem is resolved.


That *thing* again...:) Anyways, that was a very quick 'throw together' just to give an example. It is simple and I like simple (if CSS can *ever* be simple that is.:))


No kidding. I am sure over time I will look back and think it quite simple and logical, but right now I am floundering a bit. I am going to jump into the XML world in the coming days which will probably really get my head spinning.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to rdouglass)
Tailslide

 

Posts: 6046
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: How can I do this without a table? - 5/5/2006 10:03:26   
You will, honestly Duane. It's a totally different way of looking at web designing/building and it takes a while to get to grips with it - but it really does become mostly very logical. There certainly are cross-browser issues but on the whole I'd suggest learning to avoid them rather than try to "fix" them all (which is possible but boring frankly).

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> How can I do this without a table?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts