私はJSFiddlehttp : //jsfiddle.net/uWUBE/であなたのために素早く汚い「ハック」を作成しました
それがあなたを助けることを願っています、あなたはそれをよりダイナミックになるように編集することができます。ここにいくつかのコードがあります。基本的に、単語の量をループして、列に割り当てる文字列に追加します。私はJavascriptの首謀者ではないので、もっと良い方法があるかもしれません。
`
// Get the text
var txt = $("p").text();
// Split every word
var words = txt.split(" ");
// Count the amount of words
var amount = words.length
// Amount of columns
var columnAmount = 2
// Amount of words in first colum
var firstColumn = Math.floor(amount / columnAmount);
// String for first column
var firstColumnTxt = "";
// String for second column
var secondColumnTxt = "";
// loop trough the words and add them to the first column
for (var i = 0; i < firstColumn; i++){
firstColumnTxt = firstColumnTxt + " " + words[i];
}
// loop trough the words and add them to the second column
for (var i = firstColumn; i < amount; i++){
secondColumnTxt = secondColumnTxt + " " + words[i];
}
// Add this to your first column
console.log(firstColumnTxt);
// Add this to your second column
console.log(secondColumnTxt);
`