In a text file I use TAB to create a column-like grid, but apparently those tabs are just read as spaces, which of course breaks the formatting.
This is my code (path
is the file path, e.g. D:/folder/testtt.txt
):
if (File.Exists(path))
{
using (TextReader tr = new StreamReader(path))
{
while (tr.Peek() != -1)
{
Response.Write(tr.ReadLine() + "<br/>");
}
}
}
This is how it should appear:
And this is how it currently appears:
How can I fix that?
There's no tab entity defined in ISO-8859-1 HTML, so I think you can replace tab characters with some
characters: