How to correctly use tr and th in HTML, etc?

1

Hi guys I have a question, I have a table of types of cars with the respective ID and Name, what I want to do is add an edit button next to each field and every time you click on a button redirects me to a page type_edit depending on the id of the car.

This is my code:

<%

 if isArray(listaTipo) then
 Response.Write("<div class='row-fluid sortable'>")
 Response.write("<div class='box span6'>")
 Response.Write("<div class='header'>")
 response.write("<h2><i class=''></i><span class='break'></span>TABLA TIPOS DE AUTOS</h2>")
 Response.Write("<table class='table table-bordered table-striped table-condensed'><thead><tr><th>ID Auto</th><th>Tipo de Auto</th><th>Accion</th></tr></thead>")
 for i = lbound(listaTipo ,2) to ubound(listaTipo ,2)             
      Response.write ("<tr><td>"& listaTipo(0,i) &"</td><td>"& listaTipo(1,i) &"</td></tr>")
      Response.write("<tr><td ><a class='' href='editar_tipo.asp'><i class=' fa-icon-edit'></i>  </a> </td></tr>")
 next
 Response.Write("</table>")
 Response.write("</div>")
 Response.write("</div>")
 response.write("</div>")

 else
 response.write ("<div class='alert' >")
 response.write ("No existen registros de tipos de autos")
 response.write ("</div>")
 end if

 %>

The table shows me this way and what I want is for the icon that is under the ID to be shown in action.

    
asked by Daniela 07.11.2018 в 14:07
source

2 answers

4

And if you remove the <tr> of the action. Something like that in html

   <div class='row-fluid sortable'>
     <div class='box span6'>
    <div class='header'>
    <h2><i class=''></i><span class='break'></span>TABLA TIPOS DE AUTOS</h2>
    <table class='table table-bordered table-striped table-condensed'><thead><tr><th>ID Auto</th><th>Tipo de Auto</th><th>Accion</th></tr></thead>

         <tr><td>"& listaTipo(0,i) &"</td><td>"& listaTipo(1,i) &"</td><td><a class='' href='#'><i class=' fa-icon-edit'></i></a></td></tr>
     </table>
     </div>
    </div>
    </div>


    <div class='alert' >
    </div>"
                </ul>
            </nav>
    
answered by 07.11.2018 / 14:30
source
0

The tr is a row of the table, the td are columns, while the th are also columns but are used for headings .

In your case it would be applied in the following way:

Response.write("<tr>")
Response.write("<th>"& listaTipo(0,i) &"</th>")
Response.write("<td>"& listaTipo(1,i) &"</td>")
Response.write("<td><a class='' href='editar_tipo.asp'><i class='fa-icon-edit'></i></a></td>")
Response.write("</tr>")
    
answered by 07.11.2018 в 15:17