Table Doubt with HTML5 colspan

Asked

Viewed 22 times

1

I am trying, apply the titles Fat. Credit to the columns Date of Canc. of PV, Channel Hiring Cred. and Flag and Fat. Flex for Agency/Account Dom. Ant., Agency/Account Dom. Current, Start Date of Dom. and Hiring Channel Alt. Dom. and leave the first 3 with nothing, but I’m not getting it right. Below is the HTML code:

<table style='width:80%'>
                  <tr><td><b> 2) Credenciamento e Domicílio</b></td></tr>
                  </table>
                  </center>

                  <table class='table-custom table table-striped table-hover table-vcenter' style='width:100%'>
                      <thead>
						<tr>
							  <th style="border: 1px solid black;" colspan="3">Fat. Credito </th>
							  <th style="border: 1px solid black;" colspan="3">Fat. Flex </th>
						</tr>
                          <th class='text-center' style='background-color: #ff7600; width: 9.00%'>CNPJ14</th>
                          <th class='text-center' style='background-color: #ff7600; width: 9.00%'>PV</th>
                          <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data de Creden.</th>
                          <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data de Canc. de PV</th>
						  <th class='text-center' style='background-color: #ff7600; width: 5.00%'>Canal Contratação Cred.</th>
						  <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Bandeira</th>
						  <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Agência/Conta Dom. Ant.</th>
						  <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Agência/Conta Dom. Atual</th>
						  <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data início de Dom.</th>
						  <th class='text-center' style='background-color: #ff7600; width: 5.00%'>Canal Contratação Alt. Dom.</th>
                      </thead>
                  <tbody>
                      <td align='center' valign='middle' style='border-top: 1px solid #000; line-height: 0.1em; margin: 0px 0 5px; padding-left: 2px; padding-right: 2px;'>
                       <p>Teste</p>
                       </td>
				  </tbody>
</table>

I’m trying to hit the tr’s with colspan, but nothing, has anyone ever done anything like that to give me a hint?

Community hugs!

  • Try changing the <th> where the colspan is to <td>.

  • Hello Sumback, thanks for the help, it still didn’t work, I changed the ths of colspan to td and remains the same!

1 answer

1


Dude just leave one TH empty with colspan="3" That will "push" the other back

inserir a descrição da imagem aqui

<table style='width:80%'>
    <tr>
        <td><b> 2) Credenciamento e Domicílio</b></td>
    </tr>
</table>

<table class='table-custom table table-striped table-hover table-vcenter' style='width:100%'>
    <thead>
        <tr>
            <th style="" colspan="3"></th>
            <th style="border: 1px solid black;" colspan="3">Fat. Credito </th>
            <th style="border: 1px solid black;" colspan="3">Fat. Flex </th>
        </tr>
        <th class='text-center' style='background-color: #ff7600; width: 9.00%'>CNPJ14</th>
        <th class='text-center' style='background-color: #ff7600; width: 9.00%'>PV</th>
        <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data de Creden.</th>
        <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data de Canc. de PV</th>
        <th class='text-center' style='background-color: #ff7600; width: 5.00%'>Canal Contratação Cred.</th>
        <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Bandeira</th>
        <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Agência/Conta Dom. Ant.</th>
        <th class='text-center' style='background-color: #ff7600; width: 9.00%'>Agência/Conta Dom. Atual</th>
        <th class='text-center' style='background-color: #ff7600; width: 11.00%'>Data início de Dom.</th>
        <th class='text-center' style='background-color: #ff7600; width: 5.00%'>Canal Contratação Alt. Dom.</th>
    </thead>
    <tbody>
        <td align='center' valign='middle'
            style='border-top: 1px solid #000; line-height: 0.1em; margin: 0px 0 5px; padding-left: 2px; padding-right: 2px;'>
            <p>Teste</p>
        </td>
    </tbody>
</table>

  • 1

    Thanks hugocsl was very simple, thanks for the help and all who collaborated

  • @Leandroazevedo sometimes takes time to understand how Tablea works rss. Cool that solved, later if you think the answer is this and not appear anything you think more appropriate remember to mark the beauty :)

  • 1

    Yes, I work for a long time with HTML, doubts comes more in the same Tables, thanks.

Browser other questions tagged

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