Search code examples
htmlcentering

Centering a button/text in a table


Tried everything I could think of and can't center align the "MORE INFORMATION" box. Internet searches (including here), had a lot of answers and none worked.

<tr>
  <td data-th="Product Details" class="productDetails"></td>
  <td style="align:center" data-th="Data" class="Data"><a class="btn alt misc" href="http://glasscapacitors.com/glass-capacitor-overview/"><h3> <font color= "#ffb300">MORE INFORMATION</font></h3></a></td> 
  <td data-th="Similar Parts" class="similarParts">%%Panel.SideProductRelated%%</td>
</tr>


Solution

  • To center your "More Information" title, you need to add text-align: center; to your .misc a tag.

    a.misc {
      text-align: center;
    }
    <tr>
      <td data-th="Product Details" class="productDetails"></td>
      <td style="align:center" data-th="Data" class="Data"><a class="btn alt misc" href="http://glasscapacitors.com/glass-capacitor-overview/"><h3> <font color= "#ffb300">MORE INFORMATION</font></h3></a></td> 
      <td data-th="Similar Parts" class="similarParts">%%Panel.SideProductRelated%%</td>
    </tr>