FHN Posted July 21, 2004 Share Posted July 21, 2004 Hej Jag gör en html tabell och jag vill inte att texten ska svälla ut på mer än en rad i tabellen även om den är för lång för cellen. Tänk följande kod: <table border="1" style="{table-layout: fixed;}"> <tr> <td width="100" title="Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!!" style="{text-overflow: clip;}"> <NOBR>Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!!</NOBR> </td> </tr> </table> Men nu vill jag inte använda <NOBR> utan hellre någon style som jag kan ha i en css-fil. Någon som har en lösning? Link to comment Share on other sites More sharing options...
-OZn- Posted July 21, 2004 Share Posted July 21, 2004 Använd white-space: nowrap Exempel: <td width="100" style="{ white-space: nowrap }"> Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!! </td> /OZn _______________________________________________________ Microchips - De små potatisflingorna du äter allra sist i chipspåsen Link to comment Share on other sites More sharing options...
FHN Posted July 21, 2004 Author Share Posted July 21, 2004 Tack för svaret, men tyvärr får jag inte det att fungera. På en <div> går den bra att använda, men inte på td:n som ditt exempel. Link to comment Share on other sites More sharing options...
-OZn- Posted July 21, 2004 Share Posted July 21, 2004 Märkligt... Får du alltså inte följande att fungera? <table width="10"> <tr> <td style="{ white-space: nowrap }"> Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!! </td> </tr> </table> Eller testa: <table width="10"> <tr> <td> <span style="white-space: nowrap">Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!!</span> </td> </tr> </table> /OZn _______________________________________________________ Microchips - De små potatisflingorna du äter allra sist i chipspåsen [inlägget ändrat 2004-07-21 14:08:14 av OZn] Link to comment Share on other sites More sharing options...
FHN Posted July 21, 2004 Author Share Posted July 21, 2004 Nej, tyvärr får jag inte det att fungera. Något annat förslag? Link to comment Share on other sites More sharing options...
lizardKng Posted July 21, 2004 Share Posted July 21, 2004 (FireFox-0.8) Funkar _utan_ DOCTYPE. Med DOCTYPE satt till XHTML strict funkar det INTE. Inte med transitional heller... [inlägget ändrat 2004-07-21 14:11:06 av lizardKng (pa9876)] Link to comment Share on other sites More sharing options...
-OZn- Posted July 21, 2004 Share Posted July 21, 2004 Jag editerade mitt tidigare inlägg med förslag om att testa: <table width="10"> <tr> <td> <span style="white-space: nowrap">Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!!</span> </td> </tr> </table> /OZn _______________________________________________________ Microchips - De små potatisflingorna du äter allra sist i chipspåsen Link to comment Share on other sites More sharing options...
lizardKng Posted July 21, 2004 Share Posted July 21, 2004 Den funkar Link to comment Share on other sites More sharing options...
FHN Posted July 21, 2004 Author Share Posted July 21, 2004 Span-alternativet fungerar, men jag vill helst komma åt att ha något på tabellen där jag ändå kommer ha andra formateringar för att hålla nere koden Link to comment Share on other sites More sharing options...
-OZn- Posted July 21, 2004 Share Posted July 21, 2004 Ok, prova lägga in det på alla td, alltså mellan head-taggarna: <style type="text/css"> td { white-space: nowrap } </style> Prova sen: <table width="10"> <tr> <td> Blaj blaj blaj blaj blaj blaj blaj blaj blaj !!! </td> </tr> </table> /OZn _______________________________________________________ Microchips - De små potatisflingorna du äter allra sist i chipspåsen Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.