krishna mohan
krishna mohan

Reputation: 437

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>

Upvotes: 0

Views: 641

Answers (3)

Edney
Edney

Reputation: 28

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>

Upvotes: 0

Tim Schmelter
Tim Schmelter

Reputation: 460168

Use white-space: nowrap

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

Upvotes: 4

Victor Radu
Victor Radu

Reputation: 2292

try

td{white-space: nowrap}

see if that is what you whant

Upvotes: 1

Related Questions