mattisflones
asked on
How to force line break in table cell..
Hi Guys..
I have a tablecell witch is filled dynamically.. The cell can contain lets say 15 letters.
If one text is 16+ Letters my design gets screwed up.. How do i break the text in two lines even if its one word???? What part of HTML 101 did i miss??
And no, i cant use arrays and so on.. this is MANY rows..
Please.. tired.. help..
Mattis
I have a tablecell witch is filled dynamically.. The cell can contain lets say 15 letters.
If one text is 16+ Letters my design gets screwed up.. How do i break the text in two lines even if its one word???? What part of HTML 101 did i miss??
And no, i cant use arrays and so on.. this is MANY rows..
Please.. tired.. help..
Mattis
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Btw.. 500 on this one now...
ASKER
This is the code.. The table is extended by repeats outside it..
<table width="100" border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="left" valign="top"> <div align="left"><font size="1" face="Times New Roman, Times, serif"><%= DoDateTime((Recordset1.Fie lds.Item(" Doppdatert ").Value), 2, 1030) %></font><br>
<a href="nyheter.asp?nid=<%=( Recordset1 .Fields.It em("nid"). Value)%>"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><%=left(Record set1.Field s.Item("he ader").Val ue,35)%></ font></a>< /div></td>
</tr>
</table>
<table width="100" border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="left" valign="top"> <div align="left"><font size="1" face="Times New Roman, Times, serif"><%= DoDateTime((Recordset1.Fie
<a href="nyheter.asp?nid=<%=(
</tr>
</table>
ASKER
Actually this one worked...
<td align="left" valign="top" width="100" STYLE="word-wrap:break-wor d;width:89 ;left:0">
89 instead of 100...
Thanks for your efforts guys!
<td align="left" valign="top" width="100" STYLE="word-wrap:break-wor
89 instead of 100...
Thanks for your efforts guys!
A bit like so:
<html>
<head>
<title>Whatever</title>
<style type="text/css">
table {
table-layout:fixed;
width: 200px
}
.scroller {
overflow: hidden;
text-align: left
}
</style>
</head>
<body bgcolor="#FFFFFF">
<table>
<tr>
<td><div class="scroller">Veryveryv eryveryver yveryveryv eryveryver yverylongw ord<br>
<a href="something.htm">quite quitequite quitelongw ord</a></d iv></td>
</tr>
</table>
</body>
<html>
<head>
<title>Whatever</title>
<style type="text/css">
table {
table-layout:fixed;
width: 200px
}
.scroller {
overflow: hidden;
text-align: left
}
</style>
</head>
<body bgcolor="#FFFFFF">
<table>
<tr>
<td><div class="scroller">Veryveryv
<a href="something.htm">quite
</tr>
</table>
</body>
As I said before, "word-wrap:break-word;" will only work in IE, Versions 5.5 upwards, incidentally, so a great deal of your users won't see that and it'll screw it up big time for them.
ASKER
I know! Thanks.. Its only going to be used in IE 5.5+ anyway...
Ill try the hidden stuff too..
Ill try the hidden stuff too..
ASKER
I`ve tried STYLE="word-wrap:break-wor
The table is 100Px wide, i need the tablecell to adjust height according to rows of text inside each cell.
The overflow:hidden sounds like a solution, but how to apply??? it isnt a Style is it? And could you give me examples on how to apply the table-layout:fixed thingey??