0

I am trying to set up a table for a survey using HTML-code. In some of the cells I have some text that I would like to seperate into three lines at a specific place in the text.

Name of education
Salary
Unemployment rate

All three lines should be in the same cell.

However, using a <pre></pre> tag, as suggested in this thread does not work for me.

Does anyone have a tip on how to do this?

Community
  • 1
  • 1
champlos
  • 51
  • 1
  • 4
  • 2
    please show what you have tried? adding a
    tag inside can also solve your problem...you must specify what you tried but didnt worked out..
    – RohitS Oct 07 '16 at 10:32
  • 1
    Maybe I should have mentioned, that I am very new to HTML. The
    tag worked well! Thank you!
    – champlos Oct 07 '16 at 11:11
  • 1
    thats fine...just a friendly suggestion always include what you have tried...google a bit and you will find plenty of sites/resources to go start with...:D – RohitS Oct 07 '16 at 11:55
  • Accept the answer then if that worked out. – Xenos Oct 07 '16 at 12:22

1 Answers1

1

You can use the <br /> or <br> tag (both works the same) to get multiple lines inside a cell.

below is an example:

td, tr, table {
  border: 1px solid black;
  border-collapse: collapse;
  padding: 4px;
}
<table>
  <tr>
    <td>
      Cell one
    </td>
    <td>
      Hello, <br /> you can use <br />
      the br tag to get <br />
      multiple lines inside a cell.
    </td>
  </tr>
</table>
Roy123
  • 383
  • 4
  • 17