Doubt about HTML table

Asked

Viewed 71 times

0

I am doing a small work, which contains a table as shown in the image, unfortunately I am not able to accomplish with this code:

<table border = 1>
    <tr>
      <td> Cliente </td>
      <td>         </td>
    </tr>
    <tr>
      <td> Estado do Processo </td>
      <td>                    </td>
    </tr>
    <tr>
      <td> Nº Encomenda </td>
      <td>              </td>
    </tr>
    <tr>
      <td> Interveniente </td>
      <td>               </td>
    </tr>
    <tr>
    <td> Entre Datas </td>
    <td>         </td>
    </tr>
  <table>

In other words, my idea was to make a table with 2 cells in each row, the 2nd cell of each row being completely empty. https://i.stack.imgur.com/Ef1x8.png I’m sorry if it’s simple, but I’m starting the language. Thanks in advance.

  • 1

    For me, the second column of the table became empty, as expected. I did not understand the question.

  • @Andersoncarloswoss I think he wants to put an edge around each cedula of the first column

  • But it is already so... give more details and explain the problem or what is not getting as you would like

  • Hi, the last <table> tag, you should close it, like </table>

1 answer

3


Actually the second column is empty, but since it does not have a defined width, it is without size.

You can define a width in the CSS for the second cells of each line, for example, 200px, using the pseudo-class :nth-child(2). The value 2 represents the second child element (more about Nth-Child):

table tr td:nth-child(2){
   width: 200px;
}
<table border = 1>
    <tr>
      <td> Cliente </td>
      <td>         </td>
    </tr>
    <tr>
      <td> Estado do Processo </td>
      <td>                    </td>
    </tr>
    <tr>
      <td> Nº Encomenda </td>
      <td>              </td>
    </tr>
    <tr>
      <td> Interveniente </td>
      <td>               </td>
    </tr>
    <tr>
    <td> Entre Datas </td>
    <td>         </td>
    </tr>
  </table>

Obs. in comments: table must be closed with tag </table>.

  • Excuse me for intruding, but explaining pseudo css would not be cool? Since you only left the solution without reference? Apparently the user is base.

  • Quiet! I put an explanation in the answer. Obg!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.