Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Apply classes to your TDs, apply the appropriate widths (remember to leave one of them without a width so it assumes the remainder of the width), then apply the appropriate styles. Copy and paste the code below into an editor and view in a browser to see it function.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;style type="text/css"&gt; &lt;!-- td { vertical-align: top; } .leftcolumn { background: #CCC; width: 20%; padding: 10px; } .centercolumn { background: #999; padding: 10px; width: 15%; } .rightcolumn { background: #666; padding: 10px; } --&gt; &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;table border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td class="leftcolumn"&gt;This is the left column. It is set to 20% width.&lt;/td&gt; &lt;td class="centercolumn"&gt; &lt;p&gt;Hi,&lt;/p&gt; &lt;p&gt;I want to wrap a text that is added to the TD. I have tried with style="word-wrap: break-word;" width="15%". But the wrap is not happening. Is it mandatory to give 100% width ? But I have got other controls to display so only 15% width available.&lt;/p&gt; &lt;p&gt;Need help.&lt;/p&gt; &lt;p&gt;TIA.&lt;/p&gt; &lt;/td&gt; &lt;td class="rightcolumn"&gt;This is the right column, it has no width so it assumes the remainder from the 15% and 20% assumed by the others. By default, if a width is applied and no white-space declarations are made, your text will automatically wrap.&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload