473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dynamic content, xhtml and php

greetings,

I am developping a web site in php and trying to repalce my former tr/td
with divs.

Let's say I need to print this :

productName Price Quantity

ezaezaeza 123 54
vxvxcvxc 78 65

and so forth...

Before I used to loop with a <tr> and <td>

Now, Is it possible to use divs like this :
<div id="productName">ezaezaeza</div>
<div id="price">123</div>
<div id="qn">54</div> And so on ..

The pb is that I am using xhtml and id should be unique but since there
are many products, id is no longer unique so, I do not know :)

2nd : is css a good tool for this kind of usage ?

Thank you very much for your input !
Jul 24 '05 #1
5 2206
Gabriel <ka*******@yahoo.fr> wrote:
I am developping a web site in php and trying to repalce my former tr/td
with divs.

Let's say I need to print this :

productName Price Quantity

ezaezaeza 123 54
vxvxcvxc 78 65
That looks like a data table to me. Use table markup.
Before I used to loop with a <tr> and <td>

Now, Is it possible to use divs like this :
<div id="productName">ezaezaeza</div>
<div id="price">123</div>
<div id="qn">54</div> And so on ..
Yuck. Go back to using tables. You've misunderstood - using tables for
layout is poor practice, using tables for tables is good.
The pb is that I am using xhtml and id should be unique but since there
are many products, id is no longer unique so, I do not know :)
Then use class not id.
2nd : is css a good tool for this kind of usage ?


What sort of usage? For styling data tables? Yes. For making random
divs look like tables? Sometimes.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 24 '05 #2
On 24/07/2005 22:43, Gabriel wrote:
I am developping a web site in php and trying to repalce my former tr/td
with divs.

Let's say I need to print this :

productName Price Quantity

ezaezaeza 123 54
vxvxcvxc 78 65

and so forth...

Before I used to loop with a <tr> and <td>
You should keep doing that.
Now, Is it possible to use divs [...]
Yes, but the end result will be an unstructured mess. The example above
is clearly tabular data, so it should be marked up with a TABLE element.
The pb is that I am using xhtml and id should be unique
That constraint is present in HTML, too.
but since there are many products, id is no longer unique so, I do
not know :)
It won't be necessary with a properly marked-up TABLE, but you could
(and should) have used the class attribute.
2nd : is css a good tool for this kind of usage ?
CSS isn't the issue here really. The problem is that you're taking what
was a structural relationship, and making it purely visual. That isn't a
good idea.
Thank you very much for your input !


You're welcome.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 24 '05 #3
In article <42***********************@news.free.fr>,
Gabriel <ka*******@yahoo.fr> wrote:
greetings,

I am developping a web site in php and trying to repalce my former tr/td
with divs.

Let's say I need to print this :

productName Price Quantity

ezaezaeza 123 54
vxvxcvxc 78 65

and so forth...

Before I used to loop with a <tr> and <td>

Now, Is it possible to use divs like this :
<div id="productName">ezaezaeza</div>
<div id="price">123</div>
<div id="qn">54</div> And so on ..

The pb is that I am using xhtml and id should be unique but since there
are many products, id is no longer unique so, I do not know :)
From your example, you have given a very valid example of where tables
should be used. Use a table.
2nd : is css a good tool for this kind of usage ?


Use the CSS to color backgrounds in your table or to use a different
text. Something in the formatting line. But your original example still
screams "Use a table"!

leo

--
<http://web0.greatbasin.net/~leo/
Jul 24 '05 #4
Steve Pugh <st***@pugh.net> wrote:
using tables for tables is good.


Steve meant to write "using tables for tabular data is good".

--
Spartanicus
Jul 24 '05 #5
> Use the CSS to color backgrounds in your table or to use a different
text. Something in the formatting line. But your original example still
screams "Use a table"!

leo

Yes I thought as well that it asked for a table before css was so
widesrpread and thought, wrongly, that now that css was well established
It could be used instead just everywhere.
I had some hard time to make the thing workable and thought that I was
probably missing something since everybody said that css was magic and
easy :) thus my question :)

I'll stick to tables with some class attributes then.

Thank you very much people : it is definitevely easier with tables here :)

Jul 25 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rick | last post by:
Hi.. I've got some code I wrote in PHP that will generate a new argument string for the browser, but the xhtml parser in Firefox and Opera both complain about my use of &var=value pairs. Below...
27
by: Gene Ellis | last post by:
Something strange is happening, but I bet it is a quick fix. My favicon image is showing up in the URL bar, for a couple of seconds, but then it disappears and the default browser icon is...
9
by: James Pickering | last post by:
(update with re-formulated PHP) The W3C Tutorial relating to content negotiation http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation mostly relates to Apache. I am working on...
4
by: shypen42 | last post by:
Hi, I'd like to know how to serve web pages as "cleanly" as possible, maybe validating them if it's possible. How should I do to both respect standards *and* have it work under the various IE...
1
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is...
10
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
6
by: RoomfulExpress | last post by:
Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
19
by: Rabel | last post by:
I have a page that is using tables (please no comments about this - I understand it should be css but firefox created this template) I have a menu down the left side and the bottom is supposed to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.