Permalink
Browse files

Use styles for table cell alignment instead of "align="

  • Loading branch information...
1 parent dc432cc commit ac689f3f83eb348f65ec88d4ada1979cfc9a2047 david parsons committed Oct 29, 2012
Showing with 13 additions and 12 deletions.
  1. +3 −2 generate.c
  2. +10 −10 tests/tables.t
View
5 generate.c
@@ -1433,8 +1433,9 @@ printheader(Paragraph *pp, MMIOT *f)
enum e_alignments { a_NONE, a_CENTER, a_LEFT, a_RIGHT };
-static char* alignments[] = { "", " align=\"center\"", " align=\"left\"",
- " align=\"right\"" };
+static char* alignments[] = { "", " style=\"text-align:center;\"",
+ " style=\"text-align:left;\"",
+ " style=\"text-align:right;\"" };
typedef STRING(int) Istring;
View
20 tests/tables.t
@@ -97,14 +97,14 @@ hello|sailor' \
'<table>
<thead>
<tr>
-<th align="right">a </th>
-<th align="left"> b</th>
+<th style="text-align:right;">a </th>
+<th style="text-align:left;"> b</th>
</tr>
</thead>
<tbody>
<tr>
-<td align="right">hello</td>
-<td align="left">sailor</td>
+<td style="text-align:right;">hello</td>
+<td style="text-align:left;">sailor</td>
</tr>
</tbody>
</table>'
@@ -257,16 +257,16 @@ try "table with leading |'s and alignment" \
'<table>
<thead>
<tr>
-<th align="left">AA</th>
-<th align="center">BB</th>
-<th align="right">CC</th>
+<th style="text-align:left;">AA</th>
+<th style="text-align:center;">BB</th>
+<th style="text-align:right;">CC</th>
</tr>
</thead>
<tbody>
<tr>
-<td align="left">aa</td>
-<td align="center">bb</td>
-<td align="right">cc</td>
+<td style="text-align:left;">aa</td>
+<td style="text-align:center;">bb</td>
+<td style="text-align:right;">cc</td>
</tr>
</tbody>
</table>'

0 comments on commit ac689f3

Please sign in to comment.