html උදවුවක් ඕනෙ..

The_Killer

Well-known member
  • Jan 20, 2014
    11,053
    2,201
    113
    WA, Straya 🇦🇺🦘
    www.elakiri.com
    Or use a function like this:

    protected string BreakWord(string InString, int MaxWordLength)
    {
    //split by spaces into an array
    var strArr = InString.Split(new char[] { ' ' });
    //loop through all words, if a word is longer than our max chars insert a space
    strArr = strArr.Select(x => x.Length > MaxWordLength ? x.Insert(MaxWordLength, "") : x).ToArray();
    //return our string array joined back by its spaces
    return string.Join(" ", strArr);
    }

    Java API
    https://commons.apache.org/proper/c...elease/org/apache/commons/text/WordUtils.html

    Java function (not tested)
     
    Last edited:

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,656
    113
    කැළෑ පොජ්ජේ
    hariyanne na ban..

    hUXtuhM.jpg


    HTML:
    <html><table><td width=67>P05331</td><td width=137 style=max-width:137>9OCScallacGloble/Ceyoka</td><td width=211>Calcium Lactate</td><td width=347>Calax 1s</td><td width=173>Nutrition & Blood</td></table></html>

    මේ මොකක්ද බන් රෙන්ඩරින් එන්ජින් එක? :sorry:
     

    The_Killer

    Well-known member
  • Jan 20, 2014
    11,053
    2,201
    113
    WA, Straya 🇦🇺🦘
    www.elakiri.com
    තකොට මෙලෝ දෙයක් හොයා ගන්න බෑ බන්..


    එහෙනම් උබට ඔය input text එකේ කොන්ට්‍රෝල් එකක් තියෙනවා නම් මම දුන්න ෆන්ක්ෂන් එකකින් ව්රැප් කරලම සෙට් කරන්න ටේබල් එකට. වැඩේ අහවරයි නේ?
     

    MihiCherub

    Well-known member
  • Sep 14, 2009
    18,933
    1
    9,729
    113
    Gampaha
    Inline styles gahapan..wena widihak nam na mama danna thramin :P

    HTML:
        <table border="1" style="table-layout: fixed;width: 100%;">
            <thead>
                <tr>
                    <th>Col 1</th>
                    <th style="width: 200px; word-wrap: break-word;">Col 2</th>
                    <th>Col 3</th>
                    <th>Col 4</th>
                    <th>Col 5</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>P05338</td>
                    <td style="width: 200px; word-wrap: break-word;">9OCScallacGloble/Ceyoka</td>
                    <td>Calcium Lactate</td>
                    <td>Calax 1s</td>
                    <td>Nutrition & Blood</td>
                </tr>
                <tr>
                    <td>P05338</td>
                    <td style="width: 200px; word-wrap: break-word;">9OCScallacGloble</td>
                    <td>Calcium Lactate</td>
                    <td>Calax 1s</td>
                    <td>Nutrition & Blood</td>
                </tr>
                <tr>
                    <td>P05338</td>
                    <td style="width: 200px; word-wrap: break-word;">9OCScal/Ceyoka</td>
                    <td>Calcium Lactate</td>
                    <td>Calax 1s</td>
                    <td>Nutrition & Blood</td>
                </tr>
                <tr>
                    <td>P05338</td>
                    <td style="width: 200px; word-wrap: break-word;">9OCScallacGloble/Ceyoka/9OCScallacGloble</td>
                    <td>Calcium Lactate</td>
                    <td>Calax 1s</td>
                    <td>Nutrition & Blood</td>
                </tr>                                
            </tbody>
        </table>

    මේකෙ තියෙන විදියට දාපුවාම.. :sorry:

    IhI7CcG.jpg
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,656
    113
    කැළෑ පොජ්ජේ

    මමත් දුන්නේ inline css තමා මචං :sorry::sorry:

    මුගේ අවුල තියෙන්නේ රෙන්ඩරින් වෙන්නේ මොකක් හරි ජරාවක :yes: IE ද මන්ද :eek:

    බ්‍රව්සර් එකක් ඇතුලේ නෙමෙයි නේ පෙන විදිහට මූ රන් කරන්නේ මේක...