I have some problem. If i Write large text in table without spaces, table (or div) width will increase.
For example:
<table width="70px" border="1"> <tr> <td>HEREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE </td></tr> </tabl>
I want to write a code in javascript, that will writes \n if the string length is, for instance, 300 Symbols. Or something script like this. For example, If someone add the large text in my web page, page will be stretched. OR if i have chat System in may web page.
I make the same in C, But unfortunately I don't know JS.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
main(){
int k=0, i=1, p;
printf("Enter Size Of String In Number:");
scanf("%d", &p);
char c;
freopen("dat.txt", "r", stdin);
freopen("dat2.txt", "w", stdout);
do
{
c=getchar();
if (c=='\n' || c=='\t' || c=='\b' || c=='\f' || c=='\r' ) continue;
if(k==p*i){ printf ("\n"); i++; }
printf("%c", c); k++;
}while(c!=EOF);
printf("\n\n|......%d Symbols in One String......|", p);
getch();
}


Sign In
Create Account


Back to top









