WordPress.org

Ready to get started?Download WordPress

Forums

Table in Post (6 posts)

  1. JW75
    Member
    Posted 8 years ago #

    Hi everyone,

    Pretty new to WordPress but it's been a great help to building my own website. It looks and works realy sweet.

    But can someone tell me how to get a table into a post?

  2. elz
    Member
    Posted 8 years ago #

    Just put the code into the post, in the HTML-mode.

  3. JW75
    Member
    Posted 8 years ago #

    That I tried, but then only the first row appears in the post after saving.
    Now I made a table like this:

    <table width="100%" border="0">
    <tr align="left">
    <td style="width: 60%">headrow1 </td>
    <td align="right" style="width: 10%"> headrow2 </td>
    <td align="right" style="width: 10%"> headrow3 </td>
    <td align="right" style="width: 10%"> headrow4 </td>
    <td align="center" style="width: 10%"> headrow5 </td>
    </tr>
    </table>
    <table width="100%" border="0">
    <tr align="center">
    <td align="left" style="width: 60%">row1</td>
    <td style="width: 10%">row2</td>
    <td style="width: 10%">row3</td>
    <td style="width: 10%">row</td>
    <td style="width: 10%">row4</td>
    </tr>
    </table>

    As you can see I need to start every row with <table> again. Otherwise it won't work!

  4. irakrakow
    Member
    Posted 8 years ago #

    If I understand you correctly, you want the first row to contain the headings and the next row to contain some data, with the same column widths. If that's so, I would take out the closing </table> and the starting <table> tags, making the next row start with <tr>. My code would be:

    =================================================
    <table width="100%" border="1">
    <tr align="left">
    <td style="width: 60%">headrow1 </td>
    <td align="right" style="width: 10%"> headrow2 </td>
    <td align="right" style="width: 10%"> headrow3 </td>
    <td align="right" style="width: 10%"> headrow4 </td>
    <td align="center" style="width: 10%"> headrow5 </td>
    </tr>

    <tr align="center">
    <td align="left" style="width: 60%">row1</td>
    <td style="width: 10%">row2</td>
    <td style="width: 10%">row3</td>
    <td style="width: 10%">row</td>
    <td style="width: 10%">row4</td>
    </tr>
    </table>
    ==================================================

    Also, to test, set border = "1" or something other than 0. That way the cell borders display. In production, set border back to 0 if you don't want borders.

  5. JW75
    Member
    Posted 8 years ago #

    Thanks, I'll try immediately!

  6. maidanet
    Member
    Posted 8 years ago #

    It's the RTE (Rich Text Editor) that keeps eating the codelines. See this post: http://wordpress.org/support/topic/60902

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags