0

What I intend is described in this picture made with my amazing paint skills:

intention

Hopefully it's understandable. Basically I don't a separation of 2 rows in Amount and Total but I want that with Person which will have a row beneath it with 2 columns.

Is this possible?

EDIT: It's not the same as the possible duplicate. The suggest duplicate has the second row span across all columns. I only want it on the first column "Person".

Forget
  • 142
  • 4
  • 14
  • anything is possible, what have you tried? – benomatis Apr 08 '16 at 12:03
  • 1
    Possible duplicate of [How can I construct a table header than spans multiple rows in HTML?](http://stackoverflow.com/questions/18680044/how-can-i-construct-a-table-header-than-spans-multiple-rows-in-html) – Alex K. Apr 08 '16 at 12:04
  • Not the same case, that has the second row on all of the elements. If that was the case then Amount and Total would also have Name and Age below them (or equivalent). What I want is for it to be one Cell only on those two but 3 Cells on the first. One cell Person on one row and two cells Name and Age on the second one. – Forget Apr 08 '16 at 12:11
  • 1
    Should've put the code to show what was happening. I saw that answer and applied the knowledge on my issue. However it was "eating up" one of my last columns as a result and I didn't know if I was doing it wrong since it was a bit different. Like I said to the person that answered, it's probably due to the template I'm using and not because the approach was wrong. I might've been rash on posting this, sorry and thank you. – Forget Apr 08 '16 at 12:20
  • You are welcome, but don't think that I am sarcastic, I only try to tell you that is faster if you search a few seconds in google than post a question here and wait for responses. In this case is a very easy thing that you could solve in few seconds, and you spend 20 minutes waiting for an answer here. It's not a bad question, but stackoverflow is full of answers for this same case. It's only that. No sarcasm. See you soon and good luck! – Marcos Pérez Gude Apr 08 '16 at 12:24
  • No problem, thank you! – Forget Apr 08 '16 at 12:24
  • I will upvote this question to avoid the -1 punctuation – Marcos Pérez Gude Apr 08 '16 at 12:24

1 Answers1

6

I think you don't make any effort to achieve it. As simple as colspan and rowspan. Try to read better next time, the example shared with you in comments is fine.

<table border="1">
  <tr>
    <th colspan="2">person</th>
    <th rowspan="2">amount</th>
    <th rowspan="2">total</th>
  </tr>
  <tr>
    <td>name</td>
    <td>age</td>
  </tr>
</table>
Marcos Pérez Gude
  • 21,869
  • 4
  • 38
  • 69
  • I'm sorry if it seems like it was no effort, I tried that but it messed up my table and that's why I asked, must be due to the template I'm using. I could've put my code to show I did try but didn't feel like it was worth it, Thank you, though. – Forget Apr 08 '16 at 12:17
  • Sorry if my comment disturbs you. I only try to tell you that if you read carefully and you search a few seconds in google, you will spend less time than make an image, post a question here and wait for responses (and notice the comments). It's faster if you try by yourself first. If you feel really stucked, then came here. – Marcos Pérez Gude Apr 08 '16 at 12:19
  • 1
    I just noticed you're the same one who commented, I explained a bit more why I posted the question. It was messing up other columns using rowspan. Either way, thank you for your answer. – Forget Apr 08 '16 at 12:23
  • No problem my friend! – Marcos Pérez Gude Apr 08 '16 at 12:24