|
-
Aug 7th, 2003, 09:26 AM
#1
Thread Starter
Hyperactive Member
Wrap text in table-cell
I'm trying to imitate the listview from MS in my page but have some problem with the size of cells in my table.
Q1.
I dont want the size of my "header"-cells to expand if the text is to large. I want the text to wrap instead. I have tried to set the td-width to px instead of % but that didn't work.
Q2.
Is there any javascript that lets the user resize the width of the
cells by dragging the border or dbl-kclick like in the listview?
VB Code:
<table border="1" width="50%" cellspacing="0" cellpadding="0">
<tr>
<!-- header-->
<td width="100%">
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="22%" bgcolor="#FFFF99">
<p align="center">A</p>
</td>
<td width="22%" bgcolor="#FFFF99">
<p align="center">B</p>
</td>
<td width="22%" bgcolor="#FFFF99">
<p align="center">C</p>
</td>
<td width="22%" bgcolor="#FFFF99">
<p align="center">D</p>
</td>
<td width="5%" bgcolor="#FFFF99"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<!-- Content -->
<td width="100%">
<span style='OVERFLOW: auto; WIDTH:100%; HEIGHT:170; BORDER-RIGHT: 1pt solid; BORDER-TOP: 1pt solid; BORDER-LEFT: 1pt solid; BORDER-BOTTOM: 1pt solid'>
<table align="left" border="1" width="100%">
<tr>
<td width="25%">A1</td>
<td width="25%">B1</td>
<td width="25%">C1</td>
<td width="25%">D1</td>
</tr>
<tr>
<td width="25%">A2</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A3</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A4</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A5</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A6</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A7</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
<tr>
<td width="25%">A8</td>
<td width="25%"> </td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table>
</span>
</td>
</tr>
</table>
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
-
Aug 13th, 2003, 12:31 AM
#2
Frenzied Member
A1) you have to set the pixels in the width and not percentages. the text in the cell has to be broken and cannot be continious.
A2) no you cannot resize a table. maybe a div but not a table.
you can not yuse a span tag like that. span tags are for text and not to hold things like a table. you want a div tag as that will hold it and also use the overflow property like you want. also div tag is a block level element so you might have better luck on getting it to resize by the user if you hook some javascript or DHTML on it.
look at http://www.dhtmlcentral.com/ as they use what you want.
-
Aug 13th, 2003, 02:06 AM
#3
A span is an inline element and may not contain anything but inline elements (that is, no tables, no blocks and of course no table or list parts).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|