/    Sign up×
Community /Pin to ProfileBookmark

CSS => Replacement for a dynamic table?

Hi all! I am using php to output data a row at a time. The number of rows is not fixed but depends on the amount of data. Is it possible to produce similar output with CSS without using tables at all? Also number of columns may change from one table to another.

Here is the table:

[code=php]
<table border=”1″ cellspacing=”0″ cellpadding=”6″>
<tr><th>Nameserver</th><th>TTL</th><th>Record</tr></tr>
<tr><td> a.gtld-servers.net </td><td> 172800</td><td> 192.5.6.30 </td></tr>
<tr><td> g.gtld-servers.net </td><td> 172800</td><td> 192.42.93.30 </td></tr>
</table>
[/code]

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@BonRougeJun 12.2005 — What you have there is a good example of the correct way to use tables.
Copy linkTweet thisAlerts:
@bokehauthorJun 12.2005 — Thanks for that! Is this compatible with XHTML 1.0 Strict?
Copy linkTweet thisAlerts:
@IncaWarriorJun 12.2005 — with the exception of this: border="1" cellspacing="0" cellpadding="6"

it's all good
Copy linkTweet thisAlerts:
@BonRougeJun 12.2005 — This is better and it validates. You could also take the border attribute out of the table tag and paint your borders with css...
[code=html]<table border="1" cellspacing="0" cellpadding="6">
<thead>
<tr><th>Nameserver</th><th>TTL</th><th>Record</th></tr>
</thead>
<tbody>
<tr><td> a.gtld-servers.net </td><td> 172800</td><td> 192.5.6.30 </td></tr>
<tr><td> g.gtld-servers.net </td><td> 172800</td><td> 192.42.93.30 </td></tr>
</tbody>
</table>[/code]
Copy linkTweet thisAlerts:
@BonRougeJun 12.2005 — with the exception of this: border="1" cellspacing="0" cellpadding="6"

it's all good[/QUOTE]

I was wondering about those, but if you go here : http://bonrouge.com/test/1-strictx-dtd.htm and validate that page, you'll see they pass.
Copy linkTweet thisAlerts:
@bokehauthorJun 12.2005 — Thanks for the input!
×

Success!

Help @bokeh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...