Skip <td> in HTML table

Let's say that I have the following table:

<table> <tr> <td>Example</td> </td>One</td> </tr> <tr> <td>Example</td> </td>Two</td> </tr> <tr> <td>Example</td> </td>Three</td> </tr> <tr> <!-- Here I want to skip the first <td> cell; use only second. Example: <td>(empty, possibly &nbsp;)</td> <td>blah blah blah</td> --> </tr> </table> 

If you read my comment in the last row, you will see that in the last row I want to display something in the second column of the table, while the first will remain empty. How can i do this?

As a note, I read the question / answers in this SO question , but colspan is different from what I want. I am also not familiar with css empty-cell , so if this is a solution, please provide some sample code.

+7
source share
3 answers

HTML

 <tr> <td></td> <td>content here</td> </tr> 

CSS

table { empty-cells: show;}

Leave the <td> blank; there is no reason to put a space there. &nbsp; can act a little funny, especially in tables.

+8
source

I see no reason not to do exactly what you offer: use an empty cell containing only &nbsp; ("without space"):

 <tr> <td>&nbsp;</td> <td>Whatever</td> </tr> 
+7
source

CSS code:

 table { empty-cells: show; } 

Or, alternatively, you can insert &nbsp; in <td> .

+3
source

All Articles