Is anyone good with getting text inside a table to break to a new line once it hits the edge of the table? Trying all sorts of ways and having no luck :/
Making a profile system where you could like type in a little 'player description' about yourself in one of the tables but it just keeps widening the table width making it look ugly lol.
Quick Table Question
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Quick Table Question
If you are wanting to allow the user to type in the text, it sounds like you need to use a form and implement a "text area" form element.
The indelible lord of tl;dr
Re: Quick Table Question
Just limit the width of each table cell, then it will automatically linebreak text and not widening the cell.
Or you could just write in your CSS file if you got one:
Code: Select all
<table>
<tr>
<td>Name: </td>
<td style="width: 200px;">My loooooooooooong name</td>
</tr>
<tr>
<td>Description:</td>
<td style="width: 200px;">A nice very long description here which linebreaks if the cell is wider than 200pixels!!! MORE TEXT MORE TEXT MORE TEXT</td>
</tr>
</table>
Code: Select all
td
{
width: 200px;
}
--- Game Database ---
For all your game information needs!
Visit us at: http://www.gamedatabase.eu today!
For all your game information needs!
Visit us at: http://www.gamedatabase.eu today!
Re: Quick Table Question
Bah, I know I tried setting the width a few times...was confused why it wouldn't work lol. Thanks for the help bro, I copied yours and it works smoothly nowFalken wrote:Just limit the width of each table cell, then it will automatically linebreak text and not widening the cell.
Or you could just write in your CSS file if you got one:Code: Select all
<table> <tr> <td>Name: </td> <td style="width: 200px;">My loooooooooooong name</td> </tr> <tr> <td>Description:</td> <td style="width: 200px;">A nice very long description here which linebreaks if the cell is wider than 200pixels!!! MORE TEXT MORE TEXT MORE TEXT</td> </tr> </table>
Code: Select all
td { width: 200px; }
I need to stop coding late at night, hehe.