2015-11-03 11 views
5

मेरे शब्द-रैप सबवर्ड-रैप क्यों काम नहीं कर रहा है?

<table border="1" style="width:100%"> 
 
     <thead> 
 
      <tr> 
 
      <th>very long word</th> 
 
      </tr> 
 
     </thead> 
 
     <tbody> 
 
      <tr> 
 
      <td style="word-wrap:break-word;">ablkasd/123123123/agsdfasdf/asdfasdfasdf/_sdfsdfsdf{123123-14werwwer-14124124-wefweshtsdf-235232323}/3235235/dasasdfasdfasdf.bsfs</td> 
 
      </tr> 
 
     </tbody> 
 
    </table>

स्ट्रिंग को तोड़ने नहीं है और एक पंक्ति में हमेशा होता है पर काम नहीं कर रहा।

मैं पहले से ही Word Wrap not working properly से सभी समाधान करने की कोशिश की, लेकिन अभी भी काम नहीं कर रहा

उत्तर

8

आप मेज पर जोड़ने की आवश्यकता होगी:

table {width:100%; table-layout: fixed;} 
 
table td {word-wrap:break-word;}
<table> 
 
    <thead> 
 
     <tr> 
 
     <th>very long word</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
     <tr> 
 
     <td>ablkasd/123123123/agsdfasdf/asdfasdfasdf/_sdfsdfsdf{123123-14werwwer-14124124-wefweshtsdf-235232323}/3235235/dasasdfasdfasdf.bsfs</td> 
 
     </tr> 
 
    </tbody> 
 
</table>

+1

इनलाइन के बजाय वर्गों का उपयोग करने के लिए कृपया सुझाव दें स्टाइल :) –

+1

@AlexChar मुझे लगता है कि ओपी ने सादगी के लिए इसका इस्तेमाल किया। लेकिन आप सही हैं, सीएसएस को अलग से पोस्ट करना क्लीनर है। – dfsq

संबंधित मुद्दे