Thank you John.
Actually I'm "redesigning" my client's site and he has used
fixed numbers such as <td width="200"></td> wihch, I don't
know...I wanted to avoid.
Yes, I can do it in PHP, but as you mentioned, the browser
resized the cell width according to the length of the text
string.
Thanks.
Amrit
----- Original Message -----
From: Jon Haworth
To: [EMAIL PROTECTED]
Sent: Friday, January 09, 2004 4:37 PM
Subject: [wdvltalk] Re: Table with equal width cells
Hi Amrit,
> Can we create cells of equal width without
> mentioning the "width" attribute
I don't think so - if you have different amounts of text or
different width
images in the cells, browsers will usually resize them as
they see fit.
> I want so that no matter what's the number of <td></td>
> tags I create, their width should be the same, along with
> being liquid. Can it be done?
It can, but you'll need to script it: work out how many
cells there are
going to be, and then divide 100 by that number to arrive at
the % width for
each cell. If you have PHP the code is something like this:
<?php
$cells = 5; // use 5 cells as an example
$width = intval(100 / $cells);
echo "<tr>";
for ($i = 1; $i <= $cells; $i++) {
echo '<td width="'. $width. '%">';
echo 'cell #'. $cell;
echo '</td>\n';
}
echo "</tr>";
?>
Cheers
Jon
____ . The WDVL Discussion List from WDVL.COM . ____
To Join wdvltalk, Send An Email To:
mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to
[EMAIL PROTECTED] with the words: "set WDVLTALK
pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest
version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com
_______________________
You are currently subscribed to wdvltalk as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been
contacted with.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date:
1/8/2004
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.