Centering a table header

130
February 19, 2022, at 4:10 PM

I'm having issues centering a single table header. Below is the tablea snapshot of the table Im trying to center Its header. A snapshot of the HTML code for the table

Answer 1

lots of ways to do this. I would use flex. as you can see where id='zero' the solution by カメロン does NOT work

#one{
   text-align:center;
   width:100%;
}
#two{
   margin:0 auto;
}
#three{
   display:flex;
   justify-content:center;
}
#zero th{
width:100%;
text-align:center;
}
<table>
  <tr>
    <th> one</th>
    <th>two</th>
  </tr>
  <tr>
    <td>cat</td>
    <td>dog</td>
  </tr>
</table>
<table id='zero'>
  <tr>
    <th> one</th>
    <th>two</th>
  </tr>
  <tr>
    <td>cat</td>
    <td>dog</td>
  </tr>
</table>
<table id='one'>
  <tr>
    <th> one</th>
    <th>two</th>
  </tr>
  <tr>
    <td>cat</td>
    <td>dog</td>
  </tr>
</table>
<table id='two'>
  <tr>
    <th> one</th>
    <th>two</th>
  </tr>
  <tr>
    <td>cat</td>
    <td>dog</td>
  </tr>
</table>
<div id='three'>
<table>
  <tr>
    <th> one</th>
    <th>two</th>
  </tr>
  <tr>
    <td>cat</td>
    <td>dog</td>
  </tr>
</table>
</div>

Rent Charter Buses Company
READ ALSO
Creating on/off button in react

Creating on/off button in react

I am making a button that is going to say "disable" when its on and "enable" when its offhow do I do that in react?? I have tried to make it but I have no idea where to even start, is there some syntax im missing?

157
Color changeable SVG?

Color changeable SVG?

I wish to build a website where icon colors can be easily changed with the only change of the cssI've been given a set of custom icons in form of svg files

130
Printing using JS and @media print CSS but content pushed down

Printing using JS and @media print CSS but content pushed down

My content in the print preview window is displaying down about 5 or 6 lines

153
I&#39;m having issues with my style in laravel

I'm having issues with my style in laravel

I'm getting crazy with this matter and seems i can't find a solutionI started a laravel project and i'm unable to get the css working correctly

137