Reputation: 363
Hi guys In my Html PAge...Im using white space between the words...and its not displaying correctly in Browser...Its fully Wrapped and Single white space is left between the words...wats the solution to Fix this...
Here is my code
<html>
<head>
<style type="text/css">
th {word-wrap: break-word}
</style>
</head>
<body>
<h1>Sample</h1>
<p>A paragraph.<th>Aravinth Bike</th></p>
</body>
</html>
The Output is
A heading
A paragraph.Aravinth Bike
Upvotes: 0
Views: 3395
Reputation: 5052
To explicitly add the space you can use
[represents 1 single space].
A paragraph.Aravinth Bike
Here, i've added a few
's to have the space.
Upvotes: 0
Reputation: 780974
Use the style:
th { white-space: pre; }
Or replace each of the spaces with
.
Note that your <th>
tag is likely to be ignored by browsers. <th>
has to be inside <tr>
, which has to be inside <table>
.
Upvotes: 3
Reputation: 39248
This is by design. White space is ignored by the browser. You are better off setting padding or margin using css
You can also use a pre tag which preserves white space formating.
Upvotes: 1