Help with table alignment and style

  • Unknown's avatar

    I am running the blog for the pro-democracy movement in Thailand. We need to set up a number of pages for those who have been detained by authorities as well as for those who have been killed or injured. There is currently a table running for those detained at http://redphanfa2day.wordpress.com/arrested-red-shirt-leaders-supporters/

    The code I used for this was:
    <table border=”2″ cellspacing=”0″ cellpadding=”10″ width=”430″>
    <tbody>
    <tr>
    <td width=”55″ align=”center”>
    <h2 style=”text-align: center;”>No.</h2>
    </td>
    <td width=”325″ align=”center”>
    <h2>Name</h2>
    </td>
    <td width=”55″ align=”center”>
    <h2>Charge</h2>
    </td>
    </tr>
    <tr>
    <td width=”55″>
    <h3 style=”text-align: center;”>A</h3>
    </td>
    <td width=”325″>
    <h3>B</h3>
    </td>
    <td width=”55″>
    <h3 style=”text-align: center;”>C</h3>
    </td>
    </tr>
    </tbody>
    </table>
    <table border=”2″ cellspacing=”0″ cellpadding=”10″ width=”430″>
    <tbody>
    <tr>
    <td width=”430″ align=”center”>
    <h3 style=”text-align: center;”>Full width row</h3>
    </td>
    </tr>
    </tbody>
    </table>
    <table border=”2″ cellspacing=”0″ cellpadding=”10″ width=”430″>
    <tbody>
    <tr>
    <td width=”55″>
    <h3 style=”text-align: center;”>A</h3>
    </td>
    <td width=”325″>
    <h3>B</h3>
    </td>
    <td width=”55″>
    <h3 style=”text-align: center;”>C</h3>
    </td>
    </tr>
    </tbody>

    While it serves a rough purpose I would like to make the following changes:

    1. Center the entire table in the middle of the page
    2. Define the text size instead of using the standard WordPress h2, h3, paragraph defaults.
    3. Is there a better way of inserting the full width row for the “Also currently in army custody” heading than closing the table and starting it again?

    Thanks for any assistance. Officially 88 people are dead and more than 1,800 injured. Many people are missing.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    1:
    <table class="aligncenter" [etc.]

    2:
    <tr style="font-size:90%;" [etc.]
    (90 is just an example)

    3:
    <tr><td colspan="3">TEXT SPANNING ENTIRE ROW</tr>

  • Unknown's avatar

    Sorry, forgot the closing td tag in 3:
    <tr><td colspan="3">TEXT SPANNING ENTIRE ROW</td></tr>

  • Unknown's avatar

    Thank you very much.

    If I want to apply the type size alteration to just the center column of the table do I need to apply it to each entry?

    eg., <td style=”font-size: 120%;” width=”325″>Dr Weng Tojirakarn</td>

    Also, is there a way to pad the starting point of the center column while leaving the text in the column 1 & 3 centered?

    Thank you very much for your help.

  • Unknown's avatar

    You’re welcome!

    Answer is yes and yes:
    <td style="font-size:120%;padding-left:24px;" [etc.]
    (Again 24 is an example.)

  • Unknown's avatar

    Sorry, I haven’t checked back.

    Thank you very much for your help.

  • The topic ‘Help with table alignment and style’ is closed to new replies.