Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert a tab or spaces in html [duplicate]

I'm new to html and I got this piece of code:

@{      ViewBag.Title = "Index"; }  <!DOCTYPE html>  <html>     <head>         <meta name="viewport" content="width=device-width" />         <title>View1</title>         <script src="~/Scripts/jquery-1.9.1.min.js"></script>         <script src="~/Scripts/bootstrap.min.js"></script>         <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />         <link href="~/Content/bootstrap.min.css" rel="stylesheet" />     </head>     <body>           <table>                 @foreach (var item in Model.Data)             {                  <tr>                     <td><a [email protected][item.Key]>@item.Key</a></td>                     <td>@item.Value</td>                 </tr>                                     }         </table>     </body> </html> 

I want to add a tab or spaces between: <td><a [email protected][item.Key]>@item.Key</a></td> and <td>@item.Value</td> how do I do that?

I guess adding css is the best way but I don't understand how to use it.

like image 409
President Camacho Avatar asked Dec 10 '14 13:12

President Camacho


People also ask

What does \t do in HTML?

It is equivalent to the tab character as such. Thus, from the HTML viewpoint, there is no need to “escape” it using the character reference; but you may do so e.g. if your editing program does not let you enter the character conveniently.

How do you insert a space tab in HTML text?

The &nbsp; character entity used to denote a non-breaking space which is a fixed space. This may be perceived as twice the space of a normal space. It is used to create a space in a line that cannot be broken by word wrap.

How do you insert multiple spaces in HTML?

Creating extra spaces before or after text One of the most confusing things to new users who're creating a web page is that they cannot press the spacebar multiple times to make additional spaces. To create extra spaces before, after, or in-between your text, use the &nbsp; (non-breaking space) extended HTML character.

How do you put a tab space between two words in HTML?

Type &nbsp; to add a single space. Type &ensp; to add 2 spaces. Type &emsp; to add 4 spaces.


1 Answers

You can add padding to your td with CSS:

td {    padding-right: 30px;  }
<table>    <tr>      <td><a href="#">Hello</a></td>      <td>Goodbye</td>    </tr>    <tr>      <td><a href="#">Hola</a></td>      <td>Adios</td>    </tr>  </table>

or give them a fixed width:

td {    min-width: 200px;  }
<table>    <tr>      <td><a href="#">Hello</a></td>      <td>Goodbye</td>    </tr>    <tr>      <td><a href="#">Hola</a></td>      <td>Adios</td>    </tr>  </table>
like image 77
JLRishe Avatar answered Sep 19 '22 15:09

JLRishe