table text align

I would like to create a table with text align. For example row 1 align=right, row 2=left. 

But it does not work. All the text are centered. Thanks for help

My example code: 

<table>
<thead>
<tr>
<th class="clear"></th>
</tr>
</thead>
<tbody>
<tr>
<th align="right">Unterkunft</th>
<td align="left">Ferienwohnung mit Balkon und Dachterrasse, Wohnung im 2. OG</td>
</tr>
<tr>
<th align="right">Mahlzeiten</th>
<td align="left">Selbstverpflegung</td>
</tr>
<tr>
<th align="right">Wohnfläche</th>
<td align="left">90qm</td>
</tr>
<tr>
<th align="right">Vierter Eintrag</th>
<td align="left">Dies und das und jenes</td>
</tr>
</tbody>
</table>

Comments

  • Hi,

    please send us link ti page where you got this table so we can have a look on it.

    Thanks!
  • Ok, thanks. To be honest, we have no idea who teach you such prehistoric html but the right code for table supposed to be:
    <table>
        <thead>
            <tr>
                <th class="clear"></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th class="right">Unterkunft</th>
                <td class="left">Ferienwohnung mit Balkon und Dachterrasse, Wohnung im 2. OG</td>
            </tr>
            <tr>
                <th class="right">Mahlzeiten</th>
                <td class="left">Selbstverpflegung</td>
            </tr>
            <tr>
                <th class="right">Wohnfläche</th>
                <td class="left">90qm</td>
            </tr>
            <tr>
                <th class="right">Vierter Eintrag</th>
                <td class="left">Dies und das und jenes</td>
            </tr>
        </tbody>
    </table>
    And also, you supposed to use the following css under Custom CSS section:
    th.right, td.right { text-align: right !important; }
    th.left, td.left { text-align: left !important; }
Sign In or Register to comment.