Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-25-2002, 04:13 PM   PM User | #1
freddybee
New Coder

 
Join Date: Jun 2002
Location: Paris, France
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
freddybee is an unknown quantity at this point
Question Pb with "width" of Table and "*"

Hi,

I do have a table with n+1 cells (TD).
Each of the first n cells have a content (text), the last one is empty.
My table has a width of 100%.
I want each of the first n cell to be wide enough to show the texte and the last one to fullfill the rest of the space ...
<-------------------------- width of the sreen ----------------------------->
(Text1 I Another Text I One more text I I

I have
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td>Text1</td>
<td>Another Text</td>
<td>One more Text</td>
<td width="*"></td>

But the result is that all cell are wider than supposed (there are not restrict to the width of the text).

Any idea ???

Thanks and merry xmas
__________________
[color=dark blue]Freddy Bee[/color]
freddybee is offline   Reply With Quote
Old 12-25-2002, 07:13 PM   PM User | #2
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
Try giving the cells that contain text a fixed width.
Mr J is offline   Reply With Quote
Old 12-25-2002, 09:13 PM   PM User | #3
freddybee
New Coder

 
Join Date: Jun 2002
Location: Paris, France
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
freddybee is an unknown quantity at this point
Of course that is a solution ....

.... but I do not know in advance the content (it is dynamic) so I can't fix the size of the cell !!!!

Any other idea ???

__________________
[color=dark blue]Freddy Bee[/color]
freddybee is offline   Reply With Quote
Old 12-25-2002, 09:40 PM   PM User | #4
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
Quote:
Any other idea ???
yeah

in your case either use width="100%" or just leave out width...
__________________
redhead
redhead is offline   Reply With Quote
Old 12-25-2002, 11:02 PM   PM User | #5
freddybee
New Coder

 
Join Date: Jun 2002
Location: Paris, France
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
freddybee is an unknown quantity at this point
Sorry but my table is already set with a 100% ....

If you mean the cells (TD) that doesn't work ..

Any working idea ?
__________________
[color=dark blue]Freddy Bee[/color]
freddybee is offline   Reply With Quote
Old 12-25-2002, 11:09 PM   PM User | #6
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
This is a working idea:

<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td>Text1</td>
<td>Another Text</td>
<td>One more Text</td>
<td width="100%"></td>
MCookie is offline   Reply With Quote
Old 12-26-2002, 01:07 PM   PM User | #7
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road


<table cellspacing="0" cellpadding="0" border="1" width="100%">
<tr>
<td width="100">Text1</td>
<td width="200">Another Text</td>
<td width="200">Adding a fixed with to a cell means that the text will wrap within that cell</td>
<td>&ampnbsp;</td>
</tr></table>
Mr J is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:31 AM.


Advertisement
Log in to turn off these ads.