htmlcssasp.net

td data is not coming in single line


in my web page td is not coming in single line
Weekly report for XYZ is coming in 2 lines , i need it in one line Why label content is coming in next line?

o/p Weekly Report for Testing project

desired o/p

Weekly Report for <LabelData>


 <td align="center" style="width: 100%; color: black; font-size: 12pt; font-`enter code here`family: Trebuchet MS;
                font-style: italic; background: #E4AFC1; height: 5px;white-space:nowrap">
                <b>Weekly Report for  <asp:Label ID="lblPro" runat="server"></asp:Label></b>
            </td>

Solution

  • Your table must be responsive.

    If you put your td inside a table that is not responsive, your td width try to expand 100% inside the maximum table width which is fixed.

    See these examples - wrong way:

    <table width="80px">
         <td width="100%">Weekly Report for Testing project</td> 
    </table>
    

    Right way

    <table width="100%">
         <td width="30%">column 1</td>
         <td width="40%">column 2</td>
         <td width="30%">column 3</td> 
    </table>