arturadib / strapdown

Instant and elegant Markdown documents in the browser
http://strapdownjs.com
MIT License
2.48k stars 410 forks source link

Table alignment not working (although it does in marked) #25

Open memeplex opened 11 years ago

memeplex commented 11 years ago

I'd no time to give this a look but I guess the problem is here:

// Style tables
var tableEls = document.getElementsByTagName('table');
for (var i=0, ii=tableEls.length; i<ii; i++) {
  var tableEl = tableEls[i];
  tableEl.className = 'table table-striped table-bordered';
}
memeplex commented 11 years ago

Well after some debugging I should say that strapdown is not the culprit but bootstrap instead. The themes css's are overriding the align attribute in td's. Here's a workaround to include in your html. But I think this should be done by strapdown if it's to claim that it supports the table extension properly:

<style>
  td[align=right] { text-align: right !important; }
  td[align=center] { text-align: center !important; }
  td[align=left] { text-align: left !important; }
</style>

By the way are you still actively supporting this cute project?