This problem has been tinkering for almost two days and is worth documenting
The first method, I chose the direct
var td= $ (' TD '). Text
Direct selection of all TD definition, too simple, using the console controller to print out TD to find the numbers are all together, this is a very irrational way
The second method, I used the children method, according to table TR TD First-class search, but the method is too troublesome, choose to give up
The third method, the direct find found, print out the console found just to find the TD, the content is not resolved
var $table = $ ("table"); var td = $table. FIND ("TD") Console.log (TD); if (Td.length >) { $ ("<br><br/>"). AppendTo ("TD"); return false;
Fourth time method,
$ (document). Ready (function() { var$table = $ ("table"); varTD = $table. FIND ("TD") vartt = $ ("TD"). Val (); Console.log (TT); $(' Table TD '). each (function() {Console.log ($ ( This). text ()); if($ (' table TD '). TEXT () > 30) {alert (' Fev ') $("<br><br/>"). AppendTo (' table TD '). text (); return false; } Else { $(' TD '). Val (""); return true; } }) });
Print out the value of TD, but with <br> modified TD line, the value is not changed
The fifth time method, directly change the CSS.
td{width:18% ; Word-break break-all;}
Toss half a day, really black humor
A way to add a new line of information about jquery. button to add