How can I stop my table from increasing width every time I insert loooong commentary?
I made a simple example :
<!DOCTYPE html>
<html>
<body>
<table width='350' border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<th id="row_style" bgcolor='#D6D6D6'>ID</th>
<th id="row_style" width= "50%" bgcolor='#D6D6D6'>Content</th>
<th id="row_style" bgcolor='#D6D6D6'>Date</th>
</tr>
<tr>
<td id="row_style" bgcolor='#3399FF' scope='col' width='50'>Example</td>td>
<td id="row_style" width ='10%'> Content</td>td>
<td id="row_style" bgcolor='#3399FF' scope='col' width ='10%'>Example</td>td>
<td width ='10%'></td>
</tr>
</table>
</body>
</html>
When I increase the word "content" the table width is increasing.. how can I stop this and insert a line break?
Place the line break code <BR> within the text at the point(s) you want the line to break. Notice in the examples below that the line break code can be used in data cells as well as in headers.
The <br> HTML element produces a line break in text (carriage-return).
There are several ways to prevent line breaks in content. Using is one way, and works fine between words, but using it between an empty element and some text does not have a well-defined effect. The same would apply to the more logical and more accessible approach where you use an image for an icon.
A line break can be added to HTML elements without having to utilize a break return <br> by using pseudo-elements. Pseudo-elements are used to style a specific part of an element. Here we will use ::after to style an HTML element to add a line break.
Sounds terrible but you should use:
<tr><td><br></td></tr>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With