tables ;-(

M

milkyway

Hello,

I am trying to stop some behavior going on with a table. I have been
using Visual Studio C# 2005.

Basically, the table has certain column widths to start out with. When
data is added to it (and the size of the column is too small), the data
(in this case text) in the column wraps ;-/

How can I keep the data from wrapping? What would be nice is if no
wrapping to place at all and to just be able to adjust the size of
columns manually. You know - where you place the cursor on the boundary
of the column, the cursor changes and then you can lengthen or shorten
the width of the column in order to see more (or less) data.

So, in a nutshell, I would like for the column widths (as well as the
table length and width) to remain the same size as did from the start.
Adjustment of column widths would take place only when using the mouse
;-)

How can I do this?

TIA
 
M

Mr Newbie

Im guessing here, but if you think about what the system would need to do in
order to assess the column width Its unlikely that it is going to do it for
you.

In order to assess the column with of any column, one would have to loop
through each cell and get the context, font and size and then measure this
graphically; For each iteration, one would need to adjust the column width
for each lager than previous cell until the end were reached.

If there is no automatic way of doing this then you would have to do this
manually with code.

Other comments ?

Mr N.
 
H

Hans Kesting

milkyway said:
Hello,

I am trying to stop some behavior going on with a table. I have been
using Visual Studio C# 2005.

Basically, the table has certain column widths to start out with. When
data is added to it (and the size of the column is too small), the
data (in this case text) in the column wraps ;-/

How can I keep the data from wrapping? What would be nice is if no
wrapping to place at all and to just be able to adjust the size of
columns manually. You know - where you place the cursor on the
boundary of the column, the cursor changes and then you can lengthen
or shorten the width of the column in order to see more (or less)
data.

So, in a nutshell, I would like for the column widths (as well as the
table length and width) to remain the same size as did from the start.
Adjustment of column widths would take place only when using the mouse
;-)

How can I do this?

TIA

Watch out for a too-exact layout, one that is "perfect" on your development machine.
A user might use a different browser, have different installed fonts or uses
by default a font with a different size -> gone is your careful layout!

Hans Kesting
 
B

Bruce Barker

set absolute width and overflow style for each td's content, so it can honor
the width. you would need to write client code to resize the table column
widths (adjust the content widths).

<table border=1>
<tr>
<td nowrap><div style="width:40;overflow:hidden">this fits</div></td>
<td nowrap><div style="width:40;overflow:hidden">this xxxxxxxxxxxxxxxxx
doesn't fit</div></td>
</tr>
</table>

-- bruce (sqlwork.com)
 
M

milkyway

Thanks to all for the responses ;-)

Bruce said:
set absolute width and overflow style for each td's content, so it can honor
the width. you would need to write client code to resize the table column
widths (adjust the content widths).
How would one approach the writing of clinet code to support the
widths? Is there any sample code available?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top