Hello! I have a problem 🙂 I have a text row in my DB and when i shows it into the page it is too width. I tried to limit it to 200px width <div style="width: 200px;"><?php echo $row['text']; ?></div> , but it doesnt influence....
Оhhh sorry for my bad English...
10x 🙂
You have to specify the amount of columns and rows you want in you textarea.
e.g. <textarea cols="80" rows="20">blah</textarea>
shonuff wrote:You have to specify the amount of columns and rows you want in you textarea. e.g. <textarea cols="80" rows="20">blah</textarea>
I have tried this way, but it doesnt work.... :\ The text in my DB is too long and comes out of the page limit(470px) :\
Try using an overflow css rule on the textarea see if that helps.
example: http://www.w3schools.com/css/pr_pos_overflow.asp
shonuff wrote:Try using an overflow css rule on the textarea see if that helps. example: http://www.w3schools.com/css/pr_pos_overflow.asp
Sorry, but and this way not work :\
The main idea is when the text is too big, when reach the limit of the page to turn to next row in the page. Here a picture that shows the problem:
Try just writing a portion of the DB text like this:
<?= substr($row['text'], 0, 45); ?>
or
<?= "<div>". wordwrap(strip_tags($row['text']), 45) ."</div>\n"; ?>
The CSS idea is good one too.
webnick wrote:Try just writing a portion of the DB text like this: <?= substr($row['text'], 0, 45); ?> or <?= "<div>". wordwrap(strip_tags($row['text']), 45) ."</div>\n"; ?> The CSS idea is good one too.
It works with the first example 🙂 10x Dude 😉