WordPress.org

Ready to get started?Download WordPress

Forums

Trouble creating a table on a page (8 posts)

  1. Gitominoti
    Member
    Posted 1 year ago #

    I'm having some trouble creating a table on my WordPress site. This is the code that I have now

    <table>
    <tr>
    <td><img src=http://myimage.com/thumb.png></td>
    <td>
    
    <pre><strong><span style="font-size: x-large;">Insert Title Here</span></strong>
    
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi erat metus, vehicula eu aliquet sed, porttitor nec justo. Cras pretium, nulla at condimentum sollicitudin, turpis quam viverra quam, ac imperdiet metus massa id orci. Mauris placerat, nibh in eleifend tristique, justo lacus tempus neque, non ultrices erat augue sed lacus. Duis ipsum dolor, aliquam a hendrerit eu, tempor vel risus. Suspendisse non tortor nisl, et suscipit felis. In condimentum sollicitudin erat nec iaculis. Sed quis arcu urna, et adipiscing tellus. Quisque ultrices mauris non est laoreet dignissim.</pre>
    </td>
    </tr>
    
    <tr>
    <td><img src=http://myimage.com/thumb.png></td>
    <td>
    
    <pre><strong><span style="font-size: x-large;">Insert Title Here</span></strong>
    
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi erat metus, vehicula eu aliquet sed, porttitor nec justo. Cras pretium, nulla at condimentum sollicitudin, turpis quam viverra quam, ac imperdiet metus massa id orci. Mauris placerat, nibh in eleifend tristique, justo lacus tempus neque, non ultrices erat augue sed lacus. Duis ipsum dolor, aliquam a hendrerit eu, tempor vel risus. Suspendisse non tortor nisl, et suscipit felis. In condimentum sollicitudin erat nec iaculis. Sed quis arcu urna, et adipiscing tellus. Quisque ultrices mauris non est laoreet dignissim.</pre>
    </td>
    </tr>
    </table>

    And this is what happens (top is the visual preview, to show how it should look. The bottom is what it looks like when I publish it)

    http://i.imgur.com/ZgxXz.png

    I've tried switching to the Twenty-Ten theme, and the problem is still there. I've also tried disabling all of my plugins, but the problem is still there.

    Any help would be great, thanks

  2. birgire
    Member
    Posted 1 year ago #

    Have you tried

    <table class="mytable">
    ...
    </table>
    
    <style>
    .mytable pre {margin:0;padding:0;}
    .mytable td {max-height:150px;}
    </style>
  3. Gitominoti
    Member
    Posted 1 year ago #

    That doesn't fix it

  4. birgire
    Member
    Posted 1 year ago #

    maybe !important is needed to overwrite previous style-settings:

    <table class="mytable">
    ...
    </table>
    
    <style>
    .mytable pre {margin:0 !important;padding:0 !important;}
    .mytable td {max-height:150px !important;}
    </style>
  5. birgire
    Member
    Posted 1 year ago #

    or this to debug it:

    <table class="mytable">
    ...
    </table>
    
    <style>
    .mytable pre,.mytable span,.mytable strong {margin:0 !important;padding:0 !important;clear:both;}
    .mytable td {max-height:150px !important;}
    </style>
  6. Gitominoti
    Member
    Posted 1 year ago #

    Neither of those fixed the problem either

  7. Rachel Baker
    Member
    Posted 1 year ago #

    You have declare the widths, and clear the margins. Something like this:
    http://jsfiddle.net/UHsRh/

  8. Gitominoti
    Member
    Posted 1 year ago #

    That doesn't raise the text though. That changes the width of the cell. I tried adding a line for height, but that didn't change anything

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.