Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > div, css and columns

Reply
Thread Tools

div, css and columns

 
 
Aioe
Guest
Posts: n/a
 
      10-06-2005
A php script returns an output like this:

<div class="sinistra">
<dl>
<dt>qualcosa</dt>
<dd>altro</dd>
[...]
</dl>
</div>

<div class="destra">
<dl>
<dt>qualcosa</dt>
<dd>altro</dd>
[...]
</dl>
</div>

i need a way to display these structures in two parallel columns (somewhat
like the result of:

<table>
<tr>
<td>
[contents of first div structure]
</td>
<td>
[contents of second div structure]
</td>
</tr>
</table>

is this possibile using *only* the css styles? If so, how can i *vertically*
align these div structures? (they must start in the same row)

thank you

cheers
 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      10-06-2005
In our last episode, Aioe <(E-Mail Removed)> pronounced to alt.html:

> i need a way to display these structures in two parallel columns

<snip>
> is this possibile using *only* the css styles? If so, how can i *vertically*
> align these div structures? (they must start in the same row)


..sinistra, .destra { float: left; width: 45%; }

Depending on the context that may need adjusting, but should get you on
the right track.

--
Mark Parnell
http://clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      10-07-2005
Aioe wrote:

> is this possibile using *only* the css styles?


Yes, because CSS applies to tables as well as <div>s.

However it's _not_ possible to generate the exact presentation just by
using two <div>s as you have here. A table is composed of cells within
rows. The two <div>s each containing a list is composed of two columns
that each contain cells (like newspaper columns). You'll find it hard
to control vertical alignments. If this isn't a problem for this
example, then follow Mark's advice with the floats.

I'd suggest keeping the <table> and applying CSS to that. If you have
"content" that really needs to be aligned in rows like this, then IMHO
that's a reasonable justification for regarding it as a "data table".

It's also possible to apply "table CSS" to non table HTML markup. This
was really developed as an idea for rendering XML (not HTML) purely
with CSS and making it look like a table. XML/CSS turned into a bit of
a dead end and so the whole idea has never been widely implemented
(i.e. don't use it).

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
template columns and bound columns in gridview Vinki ASP .Net Web Controls 2 04-25-2007 04:22 PM
database columns vs. gui columns and sorting ittay.dror@gmail.com Java 5 03-04-2006 10:48 AM
CSS columns problem - faux columns don't work henrybranson@hotmail.com HTML 4 11-24-2005 10:05 AM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM



Advertisments