Aligning table cells


I've finished 6. Clickable Photo Page but I'm wondering how you align the table cells?

I'd like to align my table header to the center. My code currently looks like this:

   <th style = "colspan:3">Photos</th>

I've tried changing it to <th style = "colspan:3; align: center">Photos</th>, as well as adding <p style = "text-align: center"> and <span style = "text-align: center"> but none of them work. :')


You don't need to have colspan in a style as it is an attribute to <table>. So just move it out and it should be fine.

   <th colspan="3"> blah blah </th>

you can also add a style="text-align: center;" in your <th> beside colspan. But I think colspan is good enough.


Thanks! :slight_smile:

I'm not sure why I put colspan in a style haha. I think I must've misremembered from the exercise they used it in.


No problem! Happy coding!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.