Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 8th, 2007, 08:45 AM
Steve Swift
Guest
 
Posts: n/a
Default Definition List format adjustments

I'm trying to achieve a format of definition lists that matches the
definition lists generated by IBM's "BookMaster" (from quite a few years
ago).

The effect is as if the terms and their definitions are in a two column
table, all cells vertically aligned. But I'd like to achieve it with a
combination of <DT<DDand CSS so that the result *looks* like this:

<TABLE>
<TR VALIGN=BASELINE><TD><B>Life<TD>The meaning of life
<TR VALIGN=BASELINE><TD><B>Liff<TD>The meaning of Liff
</TABLE>

I've missed out all the closing tags to avoid line splitting, but the
above works in every browser (I'd be interested in exceptions, but
that's another topic).

I've done some research, and tried a few samples, but I seem to have
stumbled on the "simplest concept that is all but impossible in CSS".
So far, all I've learned is the CSS for "put this in some weird and
inexplicable place"

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
  #2  
Old August 8th, 2007, 07:05 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Definition List format adjustments

Scripsit Steve Swift:
Quote:
I'm trying to achieve a format of definition lists that matches the
definition lists generated by IBM's "BookMaster" (from quite a few
years ago).
I have no idea of what that might be. But the rendering issue is a CSS
matter, not HTML, hence off-topic in this group. The HTML perspective is
limited to the choice of markup. This might be affected by styling
possibilities; generally, <tableis easier to style than <dl>. And since
the <dlsemantics is vague at best, as discussed recently in this group,
there is no particular benefit from using it.
Quote:
The effect is as if the terms and their definitions are in a two
column table, all cells vertically aligned.
So why don't you use a table?
Quote:
But I'd like to achieve
it with a combination of <DT<DDand CSS
Why?
Quote:
so that the result *looks*
like this:
<TABLE>
<TR VALIGN=BASELINE><TD><B>Life<TD>The meaning of life
<TR VALIGN=BASELINE><TD><B>Liff<TD>The meaning of Liff
</TABLE>
>
I've missed out all the closing tags to avoid line splitting, but the
above works in every browser (I'd be interested in exceptions, but
that's another topic).
Do you really think that the current behavior of the tag soup slurpers that
you have tested (probably a small fraction of browsers around) is an excuse
for omitting the required </Btags?
Quote:
I've done some research, and tried a few samples, but I seem to have
stumbled on the "simplest concept that is all but impossible in CSS".
So far, all I've learned is the CSS for "put this in some weird and
inexplicable place"
CSS is discussed in c.i.w.a.stylesheets. The short answer is that you are
just making life more difficult to yourself by refraining from natural
<tablemarkup and trying to produce tabular look using CSS. In theory, CSS
lets you do that, using declarations like display: table, i.e. turning the
stuff into a table... but this isn't supported by IE.

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

  #3  
Old August 8th, 2007, 08:45 PM
Steve Swift
Guest
 
Posts: n/a
Default Re: Definition List format adjustments

Thanks, Jim. You've proven H.L Mencken wrong (see
http://www.swiftys.org.uk/wiz?1099) by coming up with an answer which is
clear, simple and *right*!
This might be the moment that I embrace CSS in favour of simple HTML
formatting.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
  #4  
Old August 8th, 2007, 11:35 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Definition List format adjustments

Scripsit Steve Swift:
Quote:
Thanks, Jim. You've proven H.L Mencken wrong (see
http://www.swiftys.org.uk/wiz?1099) by coming up with an answer which
is clear, simple and *right*!
Actually, I don't think it would disprove the wisdom even if the solution
were right. The existence of correct solution does non imply non-existence
of wrong solutions.

Besides, Jim's CSS code does not address vertical alignment, which was part
of the problem description. So if it's the answer, then the problem was
different from the description. Vertical alignment works in a particular
manner for tables. Moreover, Jim's code sets an explicit width for the <dt>
elements - something you don't need to do when you use a table. (The code
sets the width to 20%. What happens when the <dtcontents is wider?)

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

  #5  
Old August 9th, 2007, 07:15 AM
Steve Swift
Guest
 
Posts: n/a
Default Re: Definition List format adjustments

Besides, Jim's CSS code does not address vertical alignment, which was
Quote:
part of the problem description.
Whether Jim's solution addresses vertical alignment or not (and as far
as I can see it does, in every browser at my disposal), it is an
absolute dead ringer for the original BookMaster definition list, which
is what I was trying to emulate. It omitted the bold weight for the DT
tag, but even my feeble attempts at CSS were up to that.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles