aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes 2 columns both having unspecified widths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "2 columns both having unspecified widths" Watch "2 columns both having unspecified widths" New topic
Author

2 columns both having unspecified widths

Ramakrishnan Viswanathan
Ranch Hand

Joined: Aug 24, 2005
Posts: 90
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


Regards<br />Ram<br /> <br />SCJP 1.4, SCBCD 1.3, (SCEA)
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Did you set the width of the table to a fixed amount?

Eric
Subhadip Chatterjee
Ranch Hand

Joined: Dec 12, 2006
Posts: 93
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!!!


Refreshing life every moment...
Ramakrishnan Viswanathan
Ranch Hand

Joined: Aug 24, 2005
Posts: 90
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2 columns both having unspecified widths