• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2 columns both having unspecified widths

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I need to create the following structure. I have a table with 1 row having 2 columns.

The first column has content whose width might vary depending on the length of the actual content. The second column needs to span from the end of the first column all the way to the end of the table. The structure that I am trying to build goes something like this.

one css class defined
.columnWidth {width:auto}

<table>
<tr>
<td class="columnWidth">
some content goes in here
</td>
<td>
some other content
</td>
<tr>
</table>


The first column has "auto" width and it expands automatically based on the content inside it. But the second column's width is determined by its content and does NOT actually expand all the way to the end of the table.

Can someone let me know if this is doable? Or is there any other way to solve this problem?

Thanks so much
Ram
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you set the width of the table to a fixed amount?

Eric
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Man,
your table has only one row with two TDs...in normal case, table's first row defines the structure for the whole Table.Now, what i don't understand is how does your 2nd TD not end up at the right hand border of Table? Both the TDs are supposed to take the whole table width space, right!!!
 
Ramakrishnan Viswanathan
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The table width is fixed to 100%.

Now let us assume that the first Td is 70% (this could vary). What i thought was the second Td will span for the remaining 30%. But this does not happen if the first Td has a width of "auto". If I do not give the width as "auto", the first Td's width does not vary based on the content.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic