html tables & inline styles

前端 未结 2 1842
孤独总比滥情好
孤独总比滥情好 2021-01-14 02:42

I don\'t have a lot of experience with HTML tables and in-line CSS, but I\'m trying to create an HTML email signature. Ideally, I\'d like to have a small image on the left,

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 03:19

    This should do the trick:

    LAST FIRST
    REALTOR | P 123.456.789
    all your minor text here | all your minor text here | all your minor text here

    UPDATE: Adjusted code per the comments:

    After viewing your jsFiddle, an important thing to note about tables is that table cell widths in each additional row all have to be the same width as the first, and all cells must add to the total width of your table.

    Here is an example that will NOT WORK:

       
       

    Although the 2nd row does add up to 600, it (and any additional rows) must have the same 200-400 split as the first row, unless you are using colspans. If you use a colspan, you could have one row, but it needs to have the same width as the cells it is spanning, so this works:

       
     

    Not a full tutorial, but I hope that helps steer you in the right direction in the future.

    Here is the code you are after:

    Rashel Adragna RASHEL ADRAGNA
    REALTOR | P 855.900.24KW
    Zopa Realty Group logo
    all your minor text here | all your minor text here | all your minor text here

    You'll note that I've added an extra 10px to some of your table cells. This in combination with align/valigns act as padding between your cells. It is a clever way to aviod actually having to add padding, margins or empty padding cells.

提交回复
热议问题