Search code examples
htmlcssdivisiontabular

Replace a div tag with table


I need to replace a div tag with a table tag. I Choose table tag cause it easier for me personally to do the edits and updating of a website This is the div code with its CSS. How to replace it to Table tag instead of div tag on this given code:

Code:

<div class="cont-grid">
    <div class="cont-grid-info">
    <h3>Tittle</h3>

         <p>Hellow World<br/>
          <h3><b>FName, 
           LastName
           ,FathersName</b>
            </h3>
         </p>
        </div>
</div>

CSS styles

.cont-grid-info{
    float:right;
    width: 69.5%;

    .cont-grid-info h3{
    font-family: 'PT Sans Narrow', sans-serif;
    font-size: 1.8em;

}
.cont-grid{
    margin-left:auto;
    margin-right:auto;

Solution

  • <div class="cont-grid">
        <table class="cont-grid-info">
            <tr>
                <th>
                    Tittle
                </th>
                <th>
                    Tittle
                </th>
                <th>
                    Tittle
                </th>
                <th>
                    Tittle
                </th>
            </tr>
            <tr>
                <td>
                    Hellow World
                </td>
                <td>
                    FName
                </td>
                <td>
                    LastName
                </td>
                <td>
                    FathersName
                </td>
                <tr>
    </div>