Display string with spaces in ASP.NET?
I need to display a string with a space in an asp.net page.
**** That's what I'm doing: ****
cell = New TableCell
cell.Text = value (lets assume value is <" test with whitespace ">
row.Cells.Add(cell)
and it displays as
<tr>
<td>" test with whitespace "</td>
</tr>
spaces in single quotes are not displayed.
I want this value to be displayed as it is on my page.
+1
source to share
2 answers
Maybe you are trying to get space before and after your text to get the spacing between the table cell border and your text?
If so, you should take a look at the CSS style " addition " or padding-left, padding-right. This will add space between the border of the tables and your text.
Add this to your page:
<style type="text/css">
td {
padding: 4px;
}
</style>
If this is not what you want, I am sorry.
+1
source to share